]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/multi.qc
Merge branch 'master' into martin-t/defaults
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / multi.qc
index 5e8c641be542735efe020f155f2d7ff556f7dcbc..24b7d5f2acc11419f32f0340462675f9d7fa2a05 100644 (file)
@@ -97,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)
        {
@@ -169,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;