From 044dfcd66ad010a5dc90918c8c9d7263afb527e1 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 31 Aug 2013 15:25:04 +1000 Subject: [PATCH] Fix melee attack not damaging correct entity --- qcsrc/common/monsters/sv_monsters.qc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 0f79997023..5760dad4fa 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -211,9 +211,7 @@ float monster_melee(entity targ, float damg, float anim, float er, float anim_fi float rdmg = damg * random(); if (self.health <= 0) - return FALSE; - if (targ == world) - return FALSE; + return FALSE; // attacking while dead?! if(dostop) { @@ -233,7 +231,7 @@ float monster_melee(entity targ, float damg, float anim, float er, float anim_fi traceline(self.origin + self.view_ofs, self.origin + v_forward * er, 0, self); if(trace_ent.takedamage) - Damage(targ, self, self, rdmg * monster_skill, deathtype, targ.origin, normalize(targ.origin - self.origin)); + Damage(trace_ent, self, self, rdmg * monster_skill, deathtype, trace_ent.origin, normalize(trace_ent.origin - self.origin)); return TRUE; } -- 2.39.2