]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/sv_main.qc
Provisions for unit testing
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / sv_main.qc
index 4aa404d75979f85c4c7e320f19e4b8a5f6228e98..cf090833a5ff61c165eb160007f3070bb038d2e0 100644 (file)
@@ -154,8 +154,13 @@ float game_delay_last;
 
 bool autocvar_sv_autopause = true;
 float RedirectionThink();
+void PM_Main(Client this);
 void StartFrame()
 {
+    // TODO: if move is more than 50ms, split it into two moves (this matches QWSV behavior and the client prediction)
+    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_NOT_A_CLIENT(it), PM_Main(it));
+    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_NOT_A_CLIENT(it), WITH(entity, self, it, PlayerPreThink()));
+
        execute_next_frame();
        if (autocvar_sv_autopause && !server_is_dedicated) Pause_TryPause(true);
 
@@ -230,6 +235,7 @@ void StartFrame()
        MUTATOR_CALLHOOK(SV_StartFrame);
 
     FOREACH_CLIENT(true, LAMBDA(GlobalStats_update(it)));
+    FOREACH_ENTITY_CLASS(STR_PLAYER, IS_NOT_A_CLIENT(it), WITH(entity, self, it, PlayerPostThink()));
 }
 
 .vector originjitter;