]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/main.qc
Merge branch 'bones_was_here/sv_playerthink_optimise' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / main.qc
index b5832d8939ae91b28b44f671007e9a619d5ec44f..40e14c906bf858e544c321cf475cada1526a9024 100644 (file)
@@ -294,9 +294,12 @@ 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();
 
@@ -365,8 +368,13 @@ void StartFrame()
        MUTATOR_CALLHOOK(SV_StartFrame);
 
        GlobalStats_updateglobal();
-       FOREACH_CLIENT(true, GlobalStats_update(it));
-       IL_EACH(g_players, IS_FAKE_CLIENT(it), PlayerPostThink(it));
+       FOREACH_CLIENT(true,
+       {
+               GlobalStats_update(it);
+               if (IS_FAKE_CLIENT(it))
+                       PlayerPostThink(it); // DP calls this for real clients only
+               PlayerFrame(it);
+       });
 }
 
 .vector originjitter;