]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/hurt.qc
trigger_hurt: minor cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / hurt.qc
index 4579fd7524af53601118a5e3e11f2c57dc780f58..7df3ee7a9598f87d27eba38e729eb91c5f3395d9 100644 (file)
@@ -1,3 +1,4 @@
+#include "hurt.qh"
 #ifdef SVQC
 void trigger_hurt_use(entity this, entity actor, entity trigger)
 {
@@ -14,7 +15,7 @@ void trigger_hurt_touch(entity this, entity toucher)
                return;
 
        if(this.team)
-               if(((this.spawnflags & 4) == 0) == (this.team != toucher.team))
+               if(((this.spawnflags & INVERT_TEAMS) == 0) == (this.team != toucher.team))
                        return;
 
        // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
@@ -34,7 +35,7 @@ void trigger_hurt_touch(entity this, entity toucher)
                                this.enemy = NULL; // I still hate you all
                        }
 
-                       Damage (toucher, this, own, this.dmg, DEATH_HURTTRIGGER.m_id, toucher.origin, '0 0 0');
+                       Damage (toucher, this, own, this.dmg, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, toucher.origin, '0 0 0');
                }
        }
        else if(toucher.damagedbytriggers)
@@ -42,7 +43,7 @@ void trigger_hurt_touch(entity this, entity toucher)
                if(toucher.takedamage)
                {
                        EXACTTRIGGER_TOUCH(this, toucher);
-                       Damage(toucher, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, toucher.origin, '0 0 0');
+                       Damage(toucher, this, this, this.dmg, DEATH_HURTTRIGGER.m_id, DMG_NOWEP, toucher.origin, '0 0 0');
                }
        }
 
@@ -52,7 +53,7 @@ void trigger_hurt_touch(entity this, entity toucher)
 /*QUAKED spawnfunc_trigger_hurt (.5 .5 .5) ?
 Any object touching this will be hurt
 set dmg to damage amount
-defalt dmg = 5
+default dmg = 1000
 */
 .entity trigger_hurt_next;
 entity trigger_hurt_last;
@@ -79,12 +80,12 @@ spawnfunc(trigger_hurt)
        trigger_hurt_last = this;
 }
 
-float tracebox_hits_trigger_hurt(vector start, vector mi, vector ma, vector end)
+bool tracebox_hits_trigger_hurt(vector start, vector min, vector max, vector end)
 {
        entity th;
 
        for(th = trigger_hurt_first; th; th = th.trigger_hurt_next)
-               if(tracebox_hits_box(start, mi, ma, end, th.absmin, th.absmax))
+               if(tracebox_hits_box(start, min, max, end, th.absmin, th.absmax))
                        return true;
 
        return false;