From c0e4ef159b83f8e265c1a61710546913abb5e15b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 5 Feb 2019 13:34:49 +0100 Subject: [PATCH] - fixed display of "Find help" text in Strife. Also moved this piece of code to a place where a real player exists. This was set at a point where the map wasn't loaded yet which caused a few problems. --- src/g_level.cpp | 20 ++++++++++---------- src/p_user.cpp | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 9d1bd9270..f3609de78 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -484,16 +484,6 @@ void G_InitNew (const char *mapname, bool bTitleLevel) ST_CreateStatusBar(bTitleLevel); setsizeneeded = true; - if (gameinfo.gametype == GAME_Strife || (SBarInfoScript[SCRIPT_CUSTOM] != NULL && SBarInfoScript[SCRIPT_CUSTOM]->GetGameType() == GAME_Strife)) - { - // Set the initial quest log text for Strife. - for (i = 0; i < MAXPLAYERS; ++i) - { - if (playeringame[i]) - players[i].SetLogText ("$TXT_FINDHELP"); - } - } - // [RH] If this map doesn't exist, bomb out if (!P_CheckMapData(mapname)) { @@ -552,6 +542,16 @@ void G_InitNew (const char *mapname, bool bTitleLevel) } G_DoLoadLevel (mapname, 0, false, !savegamerestore); + + if (gameinfo.gametype == GAME_Strife || (SBarInfoScript[SCRIPT_CUSTOM] != nullptr && SBarInfoScript[SCRIPT_CUSTOM]->GetGameType() == GAME_Strife)) + { + // Set the initial quest log text for Strife. + for (i = 0; i < MAXPLAYERS; ++i) + { + if (playeringame[i]) + players[i].SetLogText("$TXT_FINDHELP"); + } + } } // diff --git a/src/p_user.cpp b/src/p_user.cpp index 4201514c6..0f79e5edc 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -400,11 +400,11 @@ void player_t::SetLogText (const char *text) { LogText = text; - if (mo->CheckLocalView()) + if (mo && mo->CheckLocalView()) { // Print log text to console AddToConsole(-1, TEXTCOLOR_GOLD); - AddToConsole(-1, GStrings(LogText)); + AddToConsole(-1, LogText[0] == '$'? GStrings(LogText.GetChars()+1) : LogText.GetChars() ); AddToConsole(-1, "\n"); } }