Skip to content

Commit

Permalink
- Ensure g_nextskill is used everywhere so that setting skill for n…
Browse files Browse the repository at this point in the history
…ext level works properly.
  • Loading branch information
mjr4077au committed Jul 20, 2021
1 parent 33845c4 commit 675356b
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions source/core/cheats.cpp
Expand Up @@ -334,7 +334,7 @@ CCMD(levelwarp)
auto map = levelwarp_common(argv, "levelwarp", "warp to");
if (map)
{
ChangeLevel(map, -1);
ChangeLevel(map, g_nextskill);
}
}

Expand All @@ -355,7 +355,7 @@ CCMD(levelstart)
auto map = levelwarp_common(argv, "start game", "start new game at");
if (map)
{
DeferredStartGame(map, -1);
DeferredStartGame(map, g_nextskill);
}
}

Expand Down Expand Up @@ -405,7 +405,7 @@ CCMD(changemap)
Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars());
}

ChangeLevel(map, -1);
ChangeLevel(map, g_nextskill);
}

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -445,7 +445,7 @@ CCMD(map)
Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars());
}

DeferredStartGame(map, -1);
DeferredStartGame(map, g_nextskill);
}
}

Expand All @@ -462,7 +462,7 @@ CCMD(restartmap)
Printf("Must be in a game to restart a level.\n");
return;
}
ChangeLevel(currentLevel, -1);
ChangeLevel(currentLevel, g_nextskill);
}

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -493,7 +493,7 @@ CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL)
CCMD(endofgame)
{
STAT_Update(true);
ChangeLevel(nullptr, -1);
ChangeLevel(nullptr, g_nextskill);
}

//---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion source/core/mainloop.cpp
Expand Up @@ -688,7 +688,7 @@ void MainLoop ()
userConfig.CommandMap = "";
if (maprecord)
{
DeferredStartGame(maprecord, -1);
DeferredStartGame(maprecord, g_nextskill);
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/games/blood/src/messages.cpp
Expand Up @@ -421,7 +421,7 @@ static bool cheatMario(cheatseq_t* c)
if (parseArgs((char*)c->Args, &nEpisode, &nLevel) == 2)
{
auto map = FindMapByIndex(nEpisode, nLevel);
if (map) DeferredStartGame(map, -1);
if (map) DeferredStartGame(map, g_nextskill);
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/cheats.cpp
Expand Up @@ -299,7 +299,7 @@ static bool cheatLevel(cheatseq_t *s)
auto map = FindMapByIndex(volnume, levnume);
if (map)
{
ChangeLevel(map, -1);
ChangeLevel(map, g_nextskill);
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/gameexec.cpp
Expand Up @@ -3444,7 +3444,7 @@ int ParseState::parse(void)
levnume = GetGameVarID(*insptr++, g_ac, g_p);
auto level = FindMapByIndex(volnume, levnume);
if (level != nullptr)
ChangeLevel(level, -1);
ChangeLevel(level, g_nextskill);
break;
}
case concmd_myosx:
Expand Down
8 changes: 4 additions & 4 deletions source/games/sw/src/cheats.cpp
Expand Up @@ -102,7 +102,7 @@ const char *GameInterface::GenericCheat(int player, int cheat)
bool RestartCheat(cheatseq_t* c)
{
if (!checkCheat(c)) return false;
DeferredStartGame(currentLevel, -1);
DeferredStartGame(currentLevel, g_nextskill);
return true;
}

Expand All @@ -117,7 +117,7 @@ bool NextCheat(cheatseq_t* c)
if (!checkCheat(c)) return false;
if (!currentLevel) return true;
auto map = FindNextMap(currentLevel);
if (map) DeferredStartGame(map, -1);
if (map) DeferredStartGame(map, g_nextskill);
return true;
}

Expand All @@ -126,7 +126,7 @@ bool PrevCheat(cheatseq_t* c)
if (!checkCheat(c)) return false;
if (!currentLevel) return true;
auto map = FindMapByLevelNum(currentLevel->levelNumber - 1);
if (map) DeferredStartGame(map, -1);
if (map) DeferredStartGame(map, g_nextskill);
return true;
}

Expand Down Expand Up @@ -160,7 +160,7 @@ bool WarpCheat(cheatseq_t* c)
if (TEST(pp->Flags, PF_DEAD))
return true;

DeferredStartGame(maprec, -1);
DeferredStartGame(maprec, g_nextskill);
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions source/games/sw/src/player.cpp
Expand Up @@ -7045,7 +7045,7 @@ void MultiPlayLimits(void)

MapRecord *next = nullptr;
next = FindNextMap(currentLevel);
ChangeLevel(next, -1);
ChangeLevel(next, g_nextskill);
}
}

Expand Down Expand Up @@ -7206,7 +7206,7 @@ domovethings(void)
{
map = FindNextMap(currentLevel);
}
ChangeLevel(map, -1);
ChangeLevel(map, g_nextskill);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/games/sw/src/sector.cpp
Expand Up @@ -1914,7 +1914,7 @@ OperateSprite(short SpriteNum, short player_is_operating)
map = FindMapByLevelNum(sp->hitag);
else
map = FindNextMap(currentLevel);
ChangeLevel(map, -1);
ChangeLevel(map, g_nextskill);

return true;
}
Expand Down Expand Up @@ -2096,7 +2096,7 @@ OperateTripTrigger(PLAYERp pp)
map = FindMapByLevelNum(sectp->hitag);
else
map = FindNextMap(currentLevel);
ChangeLevel(map, -1);
ChangeLevel(map, g_nextskill);
break;
}

Expand Down
2 changes: 1 addition & 1 deletion source/games/sw/src/weapon.cpp
Expand Up @@ -5327,7 +5327,7 @@ ActorHealth(short SpriteNum, short amt)
if (u->Health < u->MaxHealth/2)
{
FinishAnim = ANIM_SERP;
ChangeLevel(nullptr, -1);
ChangeLevel(nullptr, g_nextskill);
return true;
}
}
Expand Down

0 comments on commit 675356b

Please sign in to comment.