]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mapobjects/trigger/jumppads.qc
move trigger_push_velocity's last_pushed check, StartFrame() should not run jump...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mapobjects / trigger / jumppads.qc
index 82f7088e57c54245fb2c0b9f0cda1ef39cf01b96..94422b3bb397d58e42b079204bf17ef14429657b 100644 (file)
@@ -242,6 +242,25 @@ vector trigger_push_velocity_calculatevelocity(entity this, vector org, entity t
        return vs + '0 0 1' * vz;
 }
 
+#ifdef SVQC
+void trigger_push_velocity_think(entity this)
+{
+       bool found = false;
+       IL_EACH(g_moveables, it.last_pushed == this,
+       {
+               if(!WarpZoneLib_ExactTrigger_Touch(this, it, false))
+                       it.last_pushed = NULL;
+               else
+                       found = true;
+       });
+
+       if(found)
+               this.nextthink = time;
+       else
+               setthink(this, func_null);
+}
+#endif
+
 bool jumppad_push(entity this, entity targ, bool is_velocity_pad)
 {
        if (!isPushable(targ))
@@ -262,6 +281,11 @@ bool jumppad_push(entity this, entity targ, bool is_velocity_pad)
                else
                {
                        targ.last_pushed = this; // may be briefly out of sync between client and server if client prediction is toggled
+
+                       #ifdef SVQC
+                       setthink(this, trigger_push_velocity_think);
+                       this.nextthink = time;
+                       #endif
                }
        }