X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fmonster%2Fzombie.qc;h=fd270a1e1efaf2142ecea7a7fd0475b38c7ccae5;hp=ec84bb948f21e8503bf1ea321cbbc03699479d9b;hb=2300937585fd409c578a516ed5e051ba389646d4;hpb=3d4a324cc2e15c1eb99209674942506eb998e2ec diff --git a/qcsrc/common/monsters/monster/zombie.qc b/qcsrc/common/monsters/monster/zombie.qc index ec84bb948..fd270a1e1 100644 --- a/qcsrc/common/monsters/monster/zombie.qc +++ b/qcsrc/common/monsters/monster/zombie.qc @@ -75,26 +75,26 @@ const float zombie_anim_spawn = 30; .vector moveto; -void M_Zombie_Attack_Leap_Touch(entity this) +void M_Zombie_Attack_Leap_Touch(entity this, entity toucher) { - if (self.health <= 0) + if (this.health <= 0) return; vector angles_face; - if(other.takedamage) + if(toucher.takedamage) { - angles_face = vectoangles(self.moveto - self.origin); + angles_face = vectoangles(this.moveto - this.origin); angles_face = normalize(angles_face) * (autocvar_g_monster_zombie_attack_leap_force); - Damage(other, self, self, (autocvar_g_monster_zombie_attack_leap_damage) * MONSTER_SKILLMOD(self), DEATH_MONSTER_ZOMBIE_JUMP.m_id, other.origin, angles_face); - settouch(self, Monster_Touch); // instantly turn it off to stop damage spam - self.state = 0; + Damage(toucher, this, this, (autocvar_g_monster_zombie_attack_leap_damage) * MONSTER_SKILLMOD(this), DEATH_MONSTER_ZOMBIE_JUMP.m_id, toucher.origin, angles_face); + settouch(this, Monster_Touch); // instantly turn it off to stop damage spam + this.state = 0; } if (trace_dphitcontents) { - self.state = 0; - settouch(self, Monster_Touch); + this.state = 0; + settouch(this, Monster_Touch); } } @@ -163,12 +163,12 @@ METHOD(Zombie, mr_think, bool(Zombie this, entity actor)) return true; } -METHOD(Zombie, mr_pain, bool(Zombie this, entity actor)) +METHOD(Zombie, mr_pain, float(Zombie this, entity actor, float damage_take, entity attacker, float deathtype)) { TC(Zombie, this); actor.pain_finished = time + 0.34; setanim(actor, ((random() > 0.5) ? actor.anim_pain1 : actor.anim_pain2), true, true, false); - return true; + return damage_take; } METHOD(Zombie, mr_death, bool(Zombie this, entity actor))