- Ensure g_nextskill is used everywhere so that setting skill for next level works properly.

This commit is contained in:
Mitchell Richters 2021-07-20 18:51:34 +10:00
parent 33845c4a23
commit 675356be1a
9 changed files with 19 additions and 19 deletions

View file

@ -334,7 +334,7 @@ CCMD(levelwarp)
auto map = levelwarp_common(argv, "levelwarp", "warp to"); auto map = levelwarp_common(argv, "levelwarp", "warp to");
if (map) if (map)
{ {
ChangeLevel(map, -1); ChangeLevel(map, g_nextskill);
} }
} }
@ -355,7 +355,7 @@ CCMD(levelstart)
auto map = levelwarp_common(argv, "start game", "start new game at"); auto map = levelwarp_common(argv, "start game", "start new game at");
if (map) if (map)
{ {
DeferredStartGame(map, -1); DeferredStartGame(map, g_nextskill);
} }
} }
@ -405,7 +405,7 @@ CCMD(changemap)
Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars()); Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars());
} }
ChangeLevel(map, -1); ChangeLevel(map, g_nextskill);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -445,7 +445,7 @@ CCMD(map)
Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars()); Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars());
} }
DeferredStartGame(map, -1); DeferredStartGame(map, g_nextskill);
} }
} }
@ -462,7 +462,7 @@ CCMD(restartmap)
Printf("Must be in a game to restart a level.\n"); Printf("Must be in a game to restart a level.\n");
return; return;
} }
ChangeLevel(currentLevel, -1); ChangeLevel(currentLevel, g_nextskill);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -493,7 +493,7 @@ CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL)
CCMD(endofgame) CCMD(endofgame)
{ {
STAT_Update(true); STAT_Update(true);
ChangeLevel(nullptr, -1); ChangeLevel(nullptr, g_nextskill);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------

View file

@ -688,7 +688,7 @@ void MainLoop ()
userConfig.CommandMap = ""; userConfig.CommandMap = "";
if (maprecord) if (maprecord)
{ {
DeferredStartGame(maprecord, -1); DeferredStartGame(maprecord, g_nextskill);
} }
} }

View file

@ -421,7 +421,7 @@ static bool cheatMario(cheatseq_t* c)
if (parseArgs((char*)c->Args, &nEpisode, &nLevel) == 2) if (parseArgs((char*)c->Args, &nEpisode, &nLevel) == 2)
{ {
auto map = FindMapByIndex(nEpisode, nLevel); auto map = FindMapByIndex(nEpisode, nLevel);
if (map) DeferredStartGame(map, -1); if (map) DeferredStartGame(map, g_nextskill);
} }
return true; return true;
} }

View file

@ -299,7 +299,7 @@ static bool cheatLevel(cheatseq_t *s)
auto map = FindMapByIndex(volnume, levnume); auto map = FindMapByIndex(volnume, levnume);
if (map) if (map)
{ {
ChangeLevel(map, -1); ChangeLevel(map, g_nextskill);
} }
return true; return true;
} }

View file

@ -3444,7 +3444,7 @@ int ParseState::parse(void)
levnume = GetGameVarID(*insptr++, g_ac, g_p); levnume = GetGameVarID(*insptr++, g_ac, g_p);
auto level = FindMapByIndex(volnume, levnume); auto level = FindMapByIndex(volnume, levnume);
if (level != nullptr) if (level != nullptr)
ChangeLevel(level, -1); ChangeLevel(level, g_nextskill);
break; break;
} }
case concmd_myosx: case concmd_myosx:

View file

@ -102,7 +102,7 @@ const char *GameInterface::GenericCheat(int player, int cheat)
bool RestartCheat(cheatseq_t* c) bool RestartCheat(cheatseq_t* c)
{ {
if (!checkCheat(c)) return false; if (!checkCheat(c)) return false;
DeferredStartGame(currentLevel, -1); DeferredStartGame(currentLevel, g_nextskill);
return true; return true;
} }
@ -117,7 +117,7 @@ bool NextCheat(cheatseq_t* c)
if (!checkCheat(c)) return false; if (!checkCheat(c)) return false;
if (!currentLevel) return true; if (!currentLevel) return true;
auto map = FindNextMap(currentLevel); auto map = FindNextMap(currentLevel);
if (map) DeferredStartGame(map, -1); if (map) DeferredStartGame(map, g_nextskill);
return true; return true;
} }
@ -126,7 +126,7 @@ bool PrevCheat(cheatseq_t* c)
if (!checkCheat(c)) return false; if (!checkCheat(c)) return false;
if (!currentLevel) return true; if (!currentLevel) return true;
auto map = FindMapByLevelNum(currentLevel->levelNumber - 1); auto map = FindMapByLevelNum(currentLevel->levelNumber - 1);
if (map) DeferredStartGame(map, -1); if (map) DeferredStartGame(map, g_nextskill);
return true; return true;
} }
@ -160,7 +160,7 @@ bool WarpCheat(cheatseq_t* c)
if (TEST(pp->Flags, PF_DEAD)) if (TEST(pp->Flags, PF_DEAD))
return true; return true;
DeferredStartGame(maprec, -1); DeferredStartGame(maprec, g_nextskill);
return true; return true;
} }

View file

@ -7045,7 +7045,7 @@ void MultiPlayLimits(void)
MapRecord *next = nullptr; MapRecord *next = nullptr;
next = FindNextMap(currentLevel); next = FindNextMap(currentLevel);
ChangeLevel(next, -1); ChangeLevel(next, g_nextskill);
} }
} }
@ -7206,7 +7206,7 @@ domovethings(void)
{ {
map = FindNextMap(currentLevel); map = FindNextMap(currentLevel);
} }
ChangeLevel(map, -1); ChangeLevel(map, g_nextskill);
} }
} }
} }

View file

@ -1914,7 +1914,7 @@ OperateSprite(short SpriteNum, short player_is_operating)
map = FindMapByLevelNum(sp->hitag); map = FindMapByLevelNum(sp->hitag);
else else
map = FindNextMap(currentLevel); map = FindNextMap(currentLevel);
ChangeLevel(map, -1); ChangeLevel(map, g_nextskill);
return true; return true;
} }
@ -2096,7 +2096,7 @@ OperateTripTrigger(PLAYERp pp)
map = FindMapByLevelNum(sectp->hitag); map = FindMapByLevelNum(sectp->hitag);
else else
map = FindNextMap(currentLevel); map = FindNextMap(currentLevel);
ChangeLevel(map, -1); ChangeLevel(map, g_nextskill);
break; break;
} }

View file

@ -5327,7 +5327,7 @@ ActorHealth(short SpriteNum, short amt)
if (u->Health < u->MaxHealth/2) if (u->Health < u->MaxHealth/2)
{ {
FinishAnim = ANIM_SERP; FinishAnim = ANIM_SERP;
ChangeLevel(nullptr, -1); ChangeLevel(nullptr, g_nextskill);
return true; return true;
} }
} }