]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/main.qc
items: don't precache 3d models and textures when simple items are enabled
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / main.qc
index cf91b9de4bafd7d6b250a860732702a82222f409..8a2da54aa4a721c2312017b0bd30ae52bd72e561 100644 (file)
@@ -186,20 +186,35 @@ void CreatureFrame_All()
        });
 }
 
-void Pause_TryPause(bool ispaused)
+void Pause_TryPause_Dedicated(entity this)
 {
-       int n = 0;
-       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
-               if (PHYS_INPUT_BUTTON_CHAT(it) != ispaused) return;
+       if (player_count == 0)
+               setpause(1);
+}
+
+void Pause_TryPause()
+{
+       int n = 0, p = 0;
+       FOREACH_CLIENT(IS_REAL_CLIENT(it), {
+               if (PHYS_INPUT_BUTTON_CHAT(it)) ++p;
                ++n;
        });
        if (!n) return;
-       setpause(ispaused);
+       if (n == p)
+               setpause(1);
+       else
+               setpause(0);
 }
 
 void SV_PausedTic(float elapsedtime)
 {
-       if (!server_is_dedicated) Pause_TryPause(false);
+       if (!server_is_dedicated)
+       {
+               if (autocvar_sv_autopause)
+                       Pause_TryPause();
+               else
+                       setpause(0);
+       }
 }
 
 void dedicated_print(string input)
@@ -268,7 +283,6 @@ Called before each frame by the server
 
 bool game_delay_last;
 
-bool autocvar_sv_autopause = false;
 void systems_update();
 void sys_phys_update(entity this, float dt);
 void StartFrame()
@@ -278,7 +292,7 @@ void StartFrame()
     IL_EACH(g_players, IS_FAKE_CLIENT(it), PlayerPreThink(it));
 
        execute_next_frame();
-       if (autocvar_sv_autopause && !server_is_dedicated) Pause_TryPause(true);
+       if (autocvar_sv_autopause && !server_is_dedicated) Pause_TryPause();
 
        delete_fn = remove_unsafely; // not during spawning!
        serverprevtime = servertime;
@@ -331,8 +345,8 @@ void StartFrame()
        CreatureFrame_All();
        CheckRules_World();
 
-       if (warmup_stage && !game_stopped && warmup_limit > 0 && time >= warmup_limit) {
-               ReadyRestart();
+       if (warmup_stage && !game_stopped && warmup_limit > 0 && time - game_starttime >= warmup_limit) {
+               ReadyRestart(true);
                return;
        }