Check for out of range gametype on map change

(cherry picked from commit 9b96964cbbfc20565a8cfdb741f4927f36df7899)
This commit is contained in:
James R 2019-11-19 12:25:50 -08:00
parent 05246f36a6
commit 401f30f27d

View file

@ -2778,7 +2778,9 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
lastgametype = gametype;
gametype = READUINT8(*cp);
if (gametype != lastgametype)
if (gametype < 0 || gametype >= NUMGAMETYPES)
gametype = lastgametype;
else if (gametype != lastgametype)
D_GameTypeChanged(lastgametype); // emulate consvar_t behavior for gametype
if (!G_RaceGametype())