float rdmg = damg * random();
if (self.health <= 0)
- return FALSE;
- if (targ == world)
- return FALSE;
+ return FALSE; // attacking while dead?!
if(dostop)
{
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;
}