]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move trigger_push_velocity last_pushed code out of execute_next_frame()
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sun, 29 Oct 2023 19:14:05 +0000 (19:14 +0000)
committerterencehill <piuntn@gmail.com>
Sun, 29 Oct 2023 19:14:05 +0000 (19:14 +0000)
qcsrc/common/physics/player.qc
qcsrc/common/util.qc
qcsrc/server/main.qc

index e7f88b27becb157837cd186c047ec6d2fb1b3fbd..1c280253d52cbf036ae4c375a1b2a9efe96847d4 100644 (file)
@@ -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);
index 08bd71298b6e70e2fa2f638d8ad8270fe1c6f5f4..df54e3536b10acdf149037ddacc8b6c4c133da12 100644 (file)
@@ -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");
index d03edc9cb2b486e12a8f9f75ae1075a488eb3128..7c010ad86ad29214bf6f377411339b5b463dbde6 100644 (file)
@@ -5,6 +5,7 @@
 #include <common/deathtypes/all.qh>
 #include <common/debug.qh>
 #include <common/mapinfo.qh>
+#include <common/mapobjects/_mod.qh>
 #include <common/monsters/sv_monsters.qh>
 #include <common/util.qh>
 #include <common/vehicles/all.qh>
@@ -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));