From f88e18e95489628b76ed5111a628656bd4531b26 Mon Sep 17 00:00:00 2001 From: Dino <8dino2@gmail.com> Date: Fri, 27 Jun 2025 22:35:54 -0400 Subject: [PATCH 1/2] Added a check in T_Damage to return early if target is dead --- src/action/g_combat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/action/g_combat.c b/src/action/g_combat.c index 4e0b8f5de..16b247cce 100644 --- a/src/action/g_combat.c +++ b/src/action/g_combat.c @@ -463,6 +463,10 @@ void T_Damage (edict_t * targ, edict_t * inflictor, edict_t * attacker, const ve if ((targ->flags & FL_GODMODE) || targ->solid == SOLID_NOT) return; //rekkie -- specators don't take damage + // Add health check early to prevent processing dead entities + if (targ->health <= 0 || !IS_ALIVE(targ)) + return; + // do this before teamplay check if (!targ->takedamage) return; From c6b78a32e16310811bfdfbca7ef6476f950fe421 Mon Sep 17 00:00:00 2001 From: Dino <8dino2@gmail.com> Date: Fri, 27 Jun 2025 23:02:38 -0400 Subject: [PATCH 2/2] Added comment --- src/action/g_combat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/action/g_combat.c b/src/action/g_combat.c index 16b247cce..34f2a2b69 100644 --- a/src/action/g_combat.c +++ b/src/action/g_combat.c @@ -464,6 +464,7 @@ void T_Damage (edict_t * targ, edict_t * inflictor, edict_t * attacker, const ve if ((targ->flags & FL_GODMODE) || targ->solid == SOLID_NOT) return; //rekkie -- specators don't take damage // Add health check early to prevent processing dead entities + // Will need to accommodate for this if you want to gib dead bodies if (targ->health <= 0 || !IS_ALIVE(targ)) return;