- fixed crash when entering 'finishgame' in the console outside of a level.

This commit is contained in:
Rachael Alexanderson 2018-01-08 16:13:35 -05:00 committed by Christoph Oelckers
parent 36b6253c3d
commit 68cd0fad76

View file

@ -592,6 +592,12 @@ CCMD(printstats)
CCMD(finishgame)
{
bool gamestatecheck = gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_FINALE;
if (!gamestatecheck)
{
Printf("Cannot use 'finishgame' while not in a game!\n");
return;
}
// This CCMD simulates an end-of-game action and exists to end mods that never exit their last level.
Net_WriteByte(DEM_FINISHGAME);
}