mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- clamp parameter to P_GiveBody to prevent overflows.
SVN r3058 (trunk)
This commit is contained in:
parent
42de20a7e4
commit
c7c4377600
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue