]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'bones_was_here/sv_playerthink_optimise' into 'master'
authorbones_was_here <bones_was_here@xonotic.au>
Sun, 25 Feb 2024 13:27:58 +0000 (13:27 +0000)
committerbones_was_here <bones_was_here@xonotic.au>
Sun, 25 Feb 2024 13:27:58 +0000 (13:27 +0000)
Move some code that only needs to run once per frame out of PlayerP*Think()

See merge request xonotic/xonotic-data.pk3dir!1238

1  2 
qcsrc/server/main.qc

index b5832d8939ae91b28b44f671007e9a619d5ec44f,a290f4032eaf2ff9a76a6d41b1bd264b39131e70..40e14c906bf858e544c321cf475cada1526a9024
@@@ -294,11 -288,15 +294,14 @@@ void systems_update()
  void sys_phys_update(entity this, float dt);
  void StartFrame()
  {
-       // 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));
+       FOREACH_CLIENT(IS_FAKE_CLIENT(it),
+       {
+               // DP calls these for real clients only
+               sys_phys_update(it, frametime); // called by SV_PlayerPhysics for players
+               PlayerPreThink(it);
+       });
  
        execute_next_frame();
 -      if (autocvar_sv_autopause && !server_is_dedicated) Pause_TryPause();
  
        delete_fn = remove_unsafely; // not during spawning!
        serverprevtime = servertime;