From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Sun, 29 Oct 2023 19:14:05 +0000 (+0000) Subject: Move trigger_push_velocity last_pushed code out of execute_next_frame() X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=59cf121580a8bd0b886ab0809850509d905e385b;p=xonotic%2Fxonotic-data.pk3dir.git Move trigger_push_velocity last_pushed code out of execute_next_frame() --- diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index e7f88b27b..1c280253d 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -839,6 +839,9 @@ void CSQC_ClientMovement_PlayerMove_Frame(entity this) // needs to be called before physics are run! if(IS_REAL_CLIENT(this)) PM_UpdateButtons(this, CS(this)); +#elif defined(CSQC) + if(this.last_pushed && !WarpZoneLib_ExactTrigger_Touch(this.last_pushed, this, false)) + this.last_pushed = NULL; #endif sys_phys_update(this, PHYS_INPUT_TIMELENGTH); diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 08bd71298..df54e3536 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -1677,21 +1677,6 @@ void Skeleton_SetBones(entity e) string to_execute_next_frame; void execute_next_frame() { -#ifdef SVQC - IL_EACH(g_moveables, it.last_pushed, - { - if(!WarpZoneLib_ExactTrigger_Touch(it.last_pushed, it, false)) - { - it.last_pushed = NULL; - } - }); -#elif defined(CSQC) - if(csqcplayer.last_pushed && !WarpZoneLib_ExactTrigger_Touch(csqcplayer.last_pushed, csqcplayer, false)) - { - csqcplayer.last_pushed = NULL; - } -#endif - if(to_execute_next_frame) { localcmd("\n", to_execute_next_frame, "\n"); diff --git a/qcsrc/server/main.qc b/qcsrc/server/main.qc index d03edc9cb..7c010ad86 100644 --- a/qcsrc/server/main.qc +++ b/qcsrc/server/main.qc @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -293,6 +294,12 @@ 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));