From 20b0d9711ccd3280dccbd884b72cf0d0d83dcffa Mon Sep 17 00:00:00 2001 From: drfrag Date: Tue, 5 Jan 2021 19:40:36 +0100 Subject: [PATCH] - Prevent damagecount overflow. --- src/p_interaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index b10788875..730392901 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1345,7 +1345,7 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da player->LastDamageType = mod; player->attacker = source; player->damagecount += damage; // add damage after armor / invuln - if (player->damagecount > 100) + if (player->damagecount > 100 || player->damagecount < 0) { player->damagecount = 100; // teleport stomp does 10k points... }