]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/jumppads.qc
Use a temporary hack to fix teleporters and jumppads not finding their targets
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / jumppads.qc
index 8c521e7dd899c1af1319585faf049e8b778c9422..07c9d6da9ba71c4ec2154d0ca04e5e824703e8c5 100644 (file)
@@ -37,7 +37,7 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht)
 
        torg = tgt.origin + (tgt.mins + tgt.maxs) * 0.5;
 
-       grav = PHYS_GRAVITY;
+       grav = PHYS_GRAVITY(other);
        if(PHYS_ENTGRAVITY(other))
                grav *= PHYS_ENTGRAVITY(other);
 
@@ -170,9 +170,11 @@ void trigger_push_touch()
                other.move_velocity = other.velocity;
        }
 
+#ifdef SVQC
        UNSET_ONGROUND(other);
-
+#elif defined(CSQC)
        other.move_flags &= ~FL_ONGROUND;
+#endif
 
 #ifdef SVQC
        if (IS_PLAYER(other))
@@ -318,8 +320,8 @@ void trigger_push_findtarget()
 }
 
 #ifdef SVQC
-float trigger_push_send(entity to, float sf)
-{SELFPARAM();
+float trigger_push_send(entity this, entity to, float sf)
+{
        WriteHeader(MSG_ENTITY, ENT_CLIENT_TRIGGER_PUSH);
        WriteByte(MSG_ENTITY, sf);
 
@@ -349,7 +351,7 @@ void trigger_push_updatelink()
 
 void trigger_push_link()
 {
-       //Net_LinkEntity(self, false, 0, trigger_push_send);
+       Net_LinkEntity(self, false, 0, trigger_push_send);
 }
 #endif
 #ifdef SVQC
@@ -404,7 +406,7 @@ bool target_push_send(entity this, entity to, float sf)
 
 void target_push_link()
 {SELFPARAM();
-       //Net_LinkEntity(self, false, 0, target_push_send);
+       Net_LinkEntity(self, false, 0, target_push_send);
        //self.SendFlags |= 1; // update
 }
 
@@ -432,11 +434,11 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH, bool isnew)
 
                self.entremove = trigger_remove_generic;
                self.solid = SOLID_TRIGGER;
-               self.draw = trigger_draw_generic;
-               self.trigger_touch = trigger_push_touch;
+               //self.draw = trigger_draw_generic;
+               self.move_touch = trigger_push_touch;
                self.drawmask = MASK_NORMAL;
                self.move_time = time;
-               trigger_push_findtarget();
+               defer(self, 0.25, trigger_push_findtarget);
        }
 
        if(sf & 2)