From 6a3a47d77a6e7bea9ad616d69d9ed75d71bbf139 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 9 Aug 2007 08:42:15 +0000 Subject: [PATCH] - Moved setting of gameskill from M_ChooseSkill to G_DoNewGame because it doesn't work in M_ChooseSkill when the full console is open. SVN r541 (trunk) --- docs/rh-log.txt | 4 ++++ src/g_level.cpp | 6 +++++- src/g_level.h | 2 +- src/m_menu.cpp | 6 ++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 28057ee1c..80ed9926b 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,7 @@ +August 9, 2007 (Changes by Graf Zahl) +- Moved setting of gameskill from M_ChooseSkill to G_DoNewGame because it + doesn't work in M_ChooseSkill when the full console is open. + July 28, 2007 (Changes by Graf Zahl) - fixed: The BFGBall's explosion sequence was missing a state. - fixed: The brown Chaos Serpent in Hexen had an incorrect sprite for its diff --git a/src/g_level.cpp b/src/g_level.cpp index 516f4c0f8..67122eba8 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1369,10 +1369,12 @@ bool CheckWarpTransMap (char mapname[9], bool substitute) // consoleplayer, playeringame[] should be set. // static char d_mapname[256]; +static int d_skill; -void G_DeferedInitNew (const char *mapname) +void G_DeferedInitNew (const char *mapname, int newskill) { strncpy (d_mapname, mapname, 8); + d_skill = newskill; CheckWarpTransMap (d_mapname, true); gameaction = ga_newgame2; } @@ -1419,6 +1421,7 @@ CCMD (open) { delete map; gameaction = ga_newgame2; + d_skill = -1; } } else @@ -1464,6 +1467,7 @@ void G_DoNewGame (void) { G_NewInit (); playeringame[consoleplayer] = 1; + if (d_skill != -1) gameskill = d_skill; G_InitNew (d_mapname, false); gameaction = ga_nothing; } diff --git a/src/g_level.h b/src/g_level.h index 3ede23b7f..bfe944e94 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -315,7 +315,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel); // Can be called by the startup code or M_Responder. // A normal game starts at map 1, // but a warp test can start elsewhere -void G_DeferedInitNew (const char *mapname); +void G_DeferedInitNew (const char *mapname, int skill = -1); void G_ExitLevel (int position, bool keepFacing); void G_SecretExitLevel (int position); diff --git a/src/m_menu.cpp b/src/m_menu.cpp index 04a64860e..eb4aaac0c 100644 --- a/src/m_menu.cpp +++ b/src/m_menu.cpp @@ -1708,8 +1708,7 @@ void M_VerifyNightmare (int ch) if (ch != 'y') return; - gameskill = 4; - G_DeferedInitNew (EpisodeMaps[epi]); + G_DeferedInitNew (EpisodeMaps[epi], 4); gamestate = gamestate == GS_FULLCONSOLE ? GS_HIDECONSOLE : gamestate; M_ClearMenus (); } @@ -1722,8 +1721,7 @@ void M_ChooseSkill (int choice) return; } - gameskill = choice; - G_DeferedInitNew (EpisodeMaps[epi]); + G_DeferedInitNew (EpisodeMaps[epi], choice); if (gamestate == GS_FULLCONSOLE) { gamestate = GS_HIDECONSOLE;