From ccbebfcf34b761b94cb504a50b6dd39b922c33eb Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 4 Oct 2024 18:33:53 +0200 Subject: [PATCH] fix kill count management in CopyFriendliness when used on corpses. --- src/playsim/p_mobj.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 0cbcb813bb..8d34e6c73b 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -803,7 +803,7 @@ DEFINE_ACTION_FUNCTION(AActor, GiveInventoryType) void AActor::CopyFriendliness (AActor *other, bool changeTarget, bool resetHealth) { - Level->total_monsters -= CountsAsKill(); + if (health > 0) Level->total_monsters -= CountsAsKill(); TIDtoHate = other->TIDtoHate; LastLookActor = other->LastLookActor; LastLookPlayerNumber = other->LastLookPlayerNumber; @@ -818,7 +818,7 @@ void AActor::CopyFriendliness (AActor *other, bool changeTarget, bool resetHealt LastHeard = target = other->target; } if (resetHealth) health = SpawnHealth(); - Level->total_monsters += CountsAsKill(); + if (health > 0) Level->total_monsters += CountsAsKill(); } DEFINE_ACTION_FUNCTION(AActor, CopyFriendliness)