]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/hurt.qc
Merge branch 'martin-t/misc' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / hurt.qc
index 92a4dd0299e66d50607e4a1e3cf7675c673d2a09..d0ba4ebd19b252e925e425bb6cd2089475cffeff 100644 (file)
@@ -1,3 +1,4 @@
+#include "hurt.qh"
 #ifdef SVQC
 void trigger_hurt_use(entity this, entity actor, entity trigger)
 {
@@ -8,23 +9,23 @@ void trigger_hurt_use(entity this, entity actor, entity trigger)
 }
 
 .float triggerhurttime;
-void trigger_hurt_touch(entity this)
+void trigger_hurt_touch(entity this, entity toucher)
 {
        if (this.active != ACTIVE_ACTIVE)
                return;
 
        if(this.team)
-               if(((this.spawnflags & 4) == 0) == (this.team != other.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 = this.enemy;
@@ -34,15 +35,15 @@ void trigger_hurt_touch(entity this)
                                this.enemy = NULL; // I still hate you all
                        }
 
-                       Damage (other, this, own, this.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, this, this, this.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');
                }
        }