From 1bf5195756a7aa889e07c19dc32befa4e1ddebf7 Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Wed, 8 Nov 2023 19:22:52 +0100 Subject: [PATCH] move trigger_push_velocity's last_pushed check, StartFrame() should not run jump pad physics code --- qcsrc/common/mapobjects/trigger/jumppads.qc | 24 +++++++++++++++++++++ qcsrc/server/main.qc | 6 ------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/qcsrc/common/mapobjects/trigger/jumppads.qc b/qcsrc/common/mapobjects/trigger/jumppads.qc index 82f7088e5..94422b3bb 100644 --- a/qcsrc/common/mapobjects/trigger/jumppads.qc +++ b/qcsrc/common/mapobjects/trigger/jumppads.qc @@ -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 } } diff --git a/qcsrc/server/main.qc b/qcsrc/server/main.qc index 7c010ad86..f22347e84 100644 --- a/qcsrc/server/main.qc +++ b/qcsrc/server/main.qc @@ -294,12 +294,6 @@ void systems_update(); void sys_phys_update(entity this, float dt); void StartFrame() { - IL_EACH(g_moveables, it.last_pushed, - { - if(!WarpZoneLib_ExactTrigger_Touch(it.last_pushed, it, false)) - it.last_pushed = NULL; - }); - // TODO: if move is more than 50ms, split it into two moves (this matches QWSV behavior and the client prediction) IL_EACH(g_players, IS_FAKE_CLIENT(it), sys_phys_update(it, frametime)); IL_EACH(g_players, IS_FAKE_CLIENT(it), PlayerPreThink(it)); -- 2.39.2