diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index baa37d56c..f15da2f3a 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -184,6 +184,7 @@ bool P_GiveBody (AActor *actor, int num) int max; player_t *player = actor->player; + num = clamp(num, -65536, 65536); // prevent overflows for bad values if (player != NULL) { max = static_cast(actor)->GetMaxHealth() + player->stamina;