]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_jumppads.qc
Merge branch 'master' into tzork/ents-onoff
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_jumppads.qc
index 9bb8f7c92034d88e0de65ba2f88e0039ed4f53f5..606f3b3dec4ce63d70b35ffecf4b259672a0a9cc 100644 (file)
@@ -127,6 +127,9 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht)
 
 void trigger_push_touch()
 {
+       if (self.active == ACTIVE_NOT) 
+               return;         
+               
        // FIXME: add a .float for whether an entity should be tossed by jumppads
        if (!other.iscreature)
        if (other.classname != "corpse")
@@ -228,8 +231,26 @@ void trigger_push_touch()
        }
 };
 
-.vector dest;
+void trigger_push_setactive(float astate)
+{
+       self.active = astate;
+               
+       if(astate == ACTIVE_NOT)
+               self.touch = SUB_Null;
+       else if (astate == ACTIVE_TOGGLE)
+       {
+               if(self.active)
+                       self.active = ACTIVE_NOT;
+               else
+                       self.active = ACTIVE_ACTIVE;
+       }
+       else
+               self.touch = trigger_push_touch;
+}
+
 
+
+.vector dest;
 void trigger_push_findtarget()
 {
        local entity e;
@@ -287,7 +308,9 @@ void spawnfunc_trigger_push()
                SetMovedir ();
 
        EXACTTRIGGER_INIT;
-
+       
+       self.active = ACTIVE_ACTIVE;    
+       self.setactive = trigger_push_setactive;
        self.use = trigger_push_use;
        self.touch = trigger_push_touch;