]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
trigger_hurt: minor cleanup
authorFreddy <schro.sb@gmail.com>
Mon, 12 Mar 2018 15:16:30 +0000 (16:16 +0100)
committerFreddy <schro.sb@gmail.com>
Mon, 12 Mar 2018 15:16:30 +0000 (16:16 +0100)
qcsrc/common/triggers/spawnflags.qh
qcsrc/common/triggers/trigger/hurt.qc

index 711fdd1f4b97a7497ff98c1931ef2ea06f818778..c4b9746314aa11d5ff427cf5da7e5ccaf9f79ab6 100644 (file)
@@ -3,6 +3,7 @@
 // generic usage
 const int START_ENABLED = BIT(0);
 const int ON_MAPLOAD = BIT(1);
+const int INVERT_TEAMS = BIT(2);
 const int NOSPLASH = BIT(8); // generic anti-splashdamage spawnflag
 
 // triggers
index 9c09f923bec779ba7495071a113cddcca0011aa3..7df3ee7a9598f87d27eba38e729eb91c5f3395d9 100644 (file)
@@ -15,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)
@@ -53,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;
@@ -80,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;