X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftrigger%2Fhurt.qc;h=4579fd7524af53601118a5e3e11f2c57dc780f58;hb=e0963448096eed4786cb3abf0da13ed0f2a7deb6;hp=82199a39311ec56ee18d3acdb2e718818afdb0ed;hpb=74cebbb48d9481bb83eccb4438283f319352cb74;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/trigger/hurt.qc b/qcsrc/common/triggers/trigger/hurt.qc index 82199a393..4579fd752 100644 --- a/qcsrc/common/triggers/trigger/hurt.qc +++ b/qcsrc/common/triggers/trigger/hurt.qc @@ -4,45 +4,45 @@ void trigger_hurt_use(entity this, entity actor, entity trigger) if(IS_PLAYER(actor)) this.enemy = actor; else - this.enemy = world; // let's just destroy it, if taking over is too much work + this.enemy = NULL; // let's just destroy it, if taking over is too much work } .float triggerhurttime; -void trigger_hurt_touch(entity this) +void trigger_hurt_touch(entity this, entity toucher) { - if (self.active != ACTIVE_ACTIVE) + if (this.active != ACTIVE_ACTIVE) return; - if(self.team) - if(((self.spawnflags & 4) == 0) == (self.team != other.team)) + if(this.team) + if(((this.spawnflags & 4) == 0) == (this.team != toucher.team)) return; // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu) - if (other.iscreature) + if (toucher.iscreature) { - if (other.takedamage) - if (other.triggerhurttime < time) + if (toucher.takedamage) + if (toucher.triggerhurttime < time) { - EXACTTRIGGER_TOUCH; - other.triggerhurttime = time + 1; + EXACTTRIGGER_TOUCH(this, toucher); + toucher.triggerhurttime = time + 1; entity own; - own = self.enemy; + own = this.enemy; if (!IS_PLAYER(own)) { - own = self; - self.enemy = world; // I still hate you all + own = this; + this.enemy = NULL; // I still hate you all } - Damage (other, self, own, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0'); + Damage (toucher, this, own, this.dmg, DEATH_HURTTRIGGER.m_id, toucher.origin, '0 0 0'); } } - else if(other.damagedbytriggers) + else if(toucher.damagedbytriggers) { - if(other.takedamage) + if(toucher.takedamage) { - EXACTTRIGGER_TOUCH; - Damage(other, self, self, self.dmg, DEATH_HURTTRIGGER.m_id, other.origin, '0 0 0'); + EXACTTRIGGER_TOUCH(this, toucher); + Damage(toucher, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, toucher.origin, '0 0 0'); } }