From: Mario Date: Sat, 31 Aug 2013 05:25:04 +0000 (+1000) Subject: Fix melee attack not damaging correct entity X-Git-Tag: xonotic-v0.8.0~241^2^2~124 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=044dfcd66ad010a5dc90918c8c9d7263afb527e1;p=xonotic%2Fxonotic-data.pk3dir.git Fix melee attack not damaging correct entity --- diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 0f7999702..5760dad4f 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; }