]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
warmup start is cyan color, warmup end is red, savestates can not be loaded nor saved... drjaska/ctscup
authordrjaska <drjaska83@gmail.com>
Sat, 14 May 2022 13:40:25 +0000 (16:40 +0300)
committerdrjaska <drjaska83@gmail.com>
Sat, 14 May 2022 13:40:25 +0000 (16:40 +0300)
qcsrc/common/gamemodes/gamemode/ctscup/sv_ctscup.qc
qcsrc/server/savestate.qc

index 833ca6548697aa993e2de4badd8b7c2368b6618d..c37e9bab3c05088f229dfbe80e3b3d6443ba3919 100644 (file)
@@ -491,7 +491,7 @@ bool CTSCUP_CanRoundStart()
        if (!tournamentStarted && (roundPlayers >= autocvar_g_ctscup_minplayers))
        {
                PrintToChatAll(" \n");
-               PrintToChatAll("^3W A R M U P  started! \n");
+               PrintToChatAll("^5W A R M U P  started! \n");
                PrintToChatAll(" \n");
                return true;
        }
@@ -543,7 +543,7 @@ bool CTSCUP_CheckRoundEnd()
                if (!tournamentStarted && (roundPlayers < autocvar_g_ctscup_minplayers))
                {
                        PrintToChatAll(" \n");
-                       PrintToChatAll("^3Not enough players!  W A R M U P  restarted! \n");
+                       PrintToChatAll("^5Not enough players!  W A R M U P  restarted! \n");
                        PrintToChatAll(" \n");
                        roundCounter = -1;
                        game_stopped = true;
@@ -590,8 +590,7 @@ bool CTSCUP_CheckRoundEnd()
                        if (everyoneHasAClearTime)
                        {
                                PrintToChatAll(" \n");
-                               PrintToChatAll("^3Everyone has a clear time! Ending warmup and starting the tournament! \n");
-                               //PrintToChatAll(" \n");
+                               PrintToChatAll("^1Everyone has a clear time! Ending warmup and starting the tournament! \n");
                                roundCounter = -1;
                                game_stopped = true;
                                round_handler_Init(5, 1, autocvar_g_ctscup_maxroundlength);
index 09d009415c0c09cce602963da38120ae5c31b2b8..89be374ccad2dd62c5ab32e2202dee9fd9b728b9 100644 (file)
@@ -2,7 +2,7 @@
 
 void SaveSaveState(entity player)
 {
-       if (player.savestate)
+       if (player.savestate && !game_stopped)
        {
                // reset loads since last save counter
                player.savestate.loadCounter = 0;
@@ -34,7 +34,7 @@ void SaveSaveState(entity player)
 
 bool LoadSaveState(entity player)
 {
-       if (player.savestate)
+       if (player.savestate && !game_stopped)
        {
                // store a counterfor loads since last save
                player.savestate.loadCounter++;
@@ -52,7 +52,7 @@ bool LoadSaveState(entity player)
                SetResource(player, RES_PLASMA, GetResource(player.savestate, RES_PLASMA));
                SetResource(player, RES_SHELLS, GetResource(player.savestate, RES_SHELLS));
                SetResource(player, RES_FUEL, GetResource(player.savestate, RES_FUEL));
-               SetResource(player, RES_HEALTH, GetResource(player.savestate, RES_HEALTH));
+               SetResource(player, RES_HEALTH, max(1, GetResource(player.savestate, RES_HEALTH)));
                SetResource(player, RES_ARMOR, GetResource(player.savestate, RES_ARMOR));
                STAT(WEAPONS, player) = STAT(WEAPONS, player.savestate);
                StatusEffects_copy(player.savestate, player.statuseffects, player.savestate.teleport_time);