Prevent infinite lives rollover to extremely negative numbers. (Discovered while messing around with pandora's box recently.)

This commit is contained in:
toaster 2019-11-07 14:06:27 +00:00
parent 96aa11c825
commit d2c6d6ad73
1 changed files with 2 additions and 0 deletions

View File

@ -1240,6 +1240,8 @@ void P_GivePlayerLives(player_t *player, INT32 numlives)
numlives = (numlives + prevlives - player->lives);
}
}
else if (player->lives == INFLIVES)
return;
player->lives += numlives;