- clamp parameter to P_GiveBody to prevent overflows.

SVN r3058 (trunk)
This commit is contained in:
Christoph Oelckers 2010-12-17 22:30:47 +00:00
parent 42de20a7e4
commit c7c4377600

View file

@ -184,6 +184,7 @@ bool P_GiveBody (AActor *actor, int num)
int max; int max;
player_t *player = actor->player; player_t *player = actor->player;
num = clamp(num, -65536, 65536); // prevent overflows for bad values
if (player != NULL) if (player != NULL)
{ {
max = static_cast<APlayerPawn*>(actor)->GetMaxHealth() + player->stamina; max = static_cast<APlayerPawn*>(actor)->GetMaxHealth() + player->stamina;