X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftrigger%2Fmulti.qc;h=24b7d5f2acc11419f32f0340462675f9d7fa2a05;hb=b465997efce43e701dc89d56d82b5ae510505056;hp=7e6311df1bc7cde481ee40b3efcf54ec58e51522;hpb=63841ddfb9349787f6380b9e9e2606e6d7ed9eb6;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/trigger/multi.qc b/qcsrc/common/triggers/trigger/multi.qc index 7e6311df1..24b7d5f2a 100644 --- a/qcsrc/common/triggers/trigger/multi.qc +++ b/qcsrc/common/triggers/trigger/multi.qc @@ -54,7 +54,7 @@ void multi_trigger(entity this) multi_wait(this); // waiting finished } else - { // we can't just remove (this) here, because this is a touch function + { // we can't just delete(this) here, because this is a touch function // called while C code is looping through area links... settouch(this, func_null); } @@ -86,9 +86,8 @@ void multi_touch(entity this, entity toucher) } // if the trigger has pressed keys, check that the player is pressing those keys - if(this.pressedkeys) - if(IS_PLAYER(toucher)) // only for players - if(!(toucher.pressedkeys & this.pressedkeys)) + if(this.pressedkeys && IS_PLAYER(toucher)) // only for players + if(!(CS(toucher).pressedkeys & this.pressedkeys)) return; EXACTTRIGGER_TOUCH(this, toucher); @@ -98,13 +97,16 @@ void multi_touch(entity this, entity toucher) multi_trigger(this); } -void multi_eventdamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) +void multi_eventdamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) { if(!this.takedamage) return; if(this.spawnflags & DOOR_NOSPLASH) if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH)) return; + if(this.team) + if(((this.spawnflags & 4) == 0) == (this.team != attacker.team)) + return; this.health = this.health - damage; if (this.health <= 0) { @@ -170,6 +172,7 @@ spawnfunc(trigger_multiple) { if (this.spawnflags & SPAWNFLAG_NOTOUCH) objerror (this, "health and notouch don't make sense\n"); + this.canteamdamage = true; this.max_health = this.health; this.event_damage = multi_eventdamage; this.takedamage = DAMAGE_YES;