]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove sv_ready_restart as this command superseedes it
authorz411 <z411@omaera.org>
Fri, 3 Dec 2021 02:56:46 +0000 (23:56 -0300)
committerz411 <z411@omaera.org>
Fri, 3 Dec 2021 02:56:46 +0000 (23:56 -0300)
qcsrc/server/command/cmd.qc
qcsrc/server/command/cmd.qh
qcsrc/server/command/vote.qc
qcsrc/server/command/vote.qh
qcsrc/server/world.qc
xonotic-server.cfg

index a8a8747e1822558f0b3c572b58a5d105b7d4c773..7241b7415dbb4487035fdca152c73ac2c99bfca8 100644 (file)
@@ -374,32 +374,25 @@ void ClientCommand_ready(entity caller, int request)  // todo: anti-spam for tog
                {
                        if (IS_CLIENT(caller))
                        {
-                               if (warmup_stage || autocvar_sv_ready_restart || g_race_qualifying == 2)
+                               if (warmup_stage || g_race_qualifying == 2)
                                {
-                                       if (!readyrestart_happened || autocvar_sv_ready_restart_repeatable)
+                                       if (time < game_starttime) // game is already restarting
+                                               return;
+                                       if (caller.ready)            // toggle
                                        {
-                                               if (time < game_starttime) // game is already restarting
-                                                       return;
-                                               if (caller.ready)            // toggle
-                                               {
-                                                       caller.ready = false;
-                                                       if(IS_PLAYER(caller) || caller.caplayer == 1)
-                                                               bprint(playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n");
-                                               }
-                                               else
-                                               {
-                                                       caller.ready = true;
-                                                       if(IS_PLAYER(caller) || caller.caplayer == 1)
-                                                               bprint(playername(caller.netname, caller.team, false), "^2 is ready\n");
-                                               }
-
-                                               // cannot reset the game while a timeout is active!
-                                               if (!timeout_status) ReadyCount();
+                                               caller.ready = false;
+                                               if(IS_PLAYER(caller) || caller.caplayer == 1)
+                                                       bprint(playername(caller.netname, caller.team, false), "^2 is ^1NOT^2 ready\n");
                                        }
                                        else
                                        {
-                                               sprint(caller, "^1Game has already been restarted\n");
+                                               caller.ready = true;
+                                               if(IS_PLAYER(caller) || caller.caplayer == 1)
+                                                       bprint(playername(caller.netname, caller.team, false), "^2 is ready\n");
                                        }
+
+                                       // cannot reset the game while a timeout is active!
+                                       if (!timeout_status) ReadyCount();
                                }
                        }
                        return;  // never fall through to usage
index f2f72157140916a6e483117cee46eabbab424fc7..802afc8bde6f86e1ed3e145df61f111ea51ec715 100644 (file)
@@ -2,8 +2,6 @@
 
 float autocvar_sv_clientcommand_antispam_time;
 int autocvar_sv_clientcommand_antispam_count;
-bool autocvar_sv_ready_restart;
-bool autocvar_sv_ready_restart_repeatable;
 
 .float cmd_floodtime;
 .float cmd_floodcount;
index ec8011a8fc236f99069de611cf55473e271b364b..695d8842e8e78753a6e5fea672136f5698a4b7d0 100644 (file)
@@ -390,25 +390,16 @@ void reset_map(bool dorespawn)
        {
                if (!MUTATOR_CALLHOOK(reset_map_players))
                {
-                       //if (restart_mapalreadyrestarted || (time < game_starttime))
-                       //{
-                               FOREACH_CLIENT(IS_PLAYER(it),
-                               {
-                                       /*
-                                       only reset players if a restart countdown is active
-                                       this can either be due to cvar sv_ready_restart_after_countdown having set
-                                       restart_mapalreadyrestarted to 1 after the countdown ended or when
-                                       sv_ready_restart_after_countdown is not used and countdown is still running
-                                       */
-                                       // PlayerScore_Clear(it);
-                                       CS(it).killcount = 0;
-                                       // stop the player from moving so that he stands still once he gets respawned
-                                       it.velocity = '0 0 0';
-                                       it.avelocity = '0 0 0';
-                                       CS(it).movement = '0 0 0';
-                                       PutClientInServer(it);
-                               });
-                       //}
+                       FOREACH_CLIENT(IS_PLAYER(it),
+                       {
+                               // PlayerScore_Clear(it);
+                               CS(it).killcount = 0;
+                               // stop the player from moving so that he stands still once he gets respawned
+                               it.velocity = '0 0 0';
+                               it.avelocity = '0 0 0';
+                               CS(it).movement = '0 0 0';
+                               PutClientInServer(it);
+                       });
                }
        }
 }
@@ -416,7 +407,6 @@ void reset_map(bool dorespawn)
 // Restarts the map after the countdown is over (and cvar sv_ready_restart_after_countdown is set)
 void ReadyRestart_think(entity this)
 {
-       restart_mapalreadyrestarted = true;
        reset_map(true);
        Score_ClearAll();
        delete(this);
@@ -437,15 +427,10 @@ void ReadyRestart_force()
                cvar_set("timelimit", ftos(autocvar_timelimit - (checkrules_overtimesadded * autocvar_timelimit_overtime)));
        checkrules_suddendeathend = checkrules_overtimesadded = checkrules_suddendeathwarning = 0;
        
-       if(warmup_stage) {
-               // Warmup: No countdown in warmup
-               game_starttime = time;
-               readyrestart_happened = false;
-       } else {
-               // Go into match mode
-               readyrestart_happened = true;
-               game_starttime = time + RESTART_COUNTDOWN;
-       }
+       if(warmup_stage)
+               game_starttime = time; // Warmup: No countdown in warmup
+       else
+               game_starttime = time + RESTART_COUNTDOWN; // Go into match mode
 
        // clear player attributes
        FOREACH_CLIENT(IS_PLAYER(it), {
@@ -455,8 +440,6 @@ void ReadyRestart_force()
                PlayerStats_GameReport_Event_Player(it, PLAYERSTATS_ALIVETIME, -val);
        });
 
-       restart_mapalreadyrestarted = false; // reset this var, needed when cvar sv_ready_restart_repeatable is in use
-
        // disable the warmup global for the server
        if(!warmup_stage)
                localcmd("\nsv_hook_warmupend\n");
index 4dfd9e8575f2abf22c9cdc1e639171ca64988e0e..843d59618e9c43a6b77310e6e8ebe9b40fb101b6 100644 (file)
@@ -63,8 +63,6 @@ void VoteCommand(int request, entity caller, int argc, string vote_command);
 const float RESTART_COUNTDOWN = 10;
 entity nagger;
 float readycount;                  // amount of players who are ready
-float readyrestart_happened;       // keeps track of whether a restart has already happened
-float restart_mapalreadyrestarted; // bool, indicates whether reset_map() was already executed
 .float ready;                      // flag for if a player is ready
 .int team_saved;                   // team number to restore upon map reset
 .void(entity this) reset;             // if set, an entity is reset using this
index e2f2fd32b79813d659990a9d1befa4cd653b4fee..00733e809142fe8e623940a25b160e3fb833f928 100644 (file)
@@ -493,7 +493,6 @@ void cvar_changes_init()
                BADCVAR("sv_maxrate");
                BADCVAR("sv_motd");
                BADCVAR("sv_public");
-               BADCVAR("sv_ready_restart");
                BADCVAR("sv_showfps");
                BADCVAR("sv_status_privacy");
                BADCVAR("sv_taunt");
index 1634c256cca1102ea23f05da17e097a0b37bc016..f6a4b6256714a6fb5340bccfc7cde814977e2cd2 100644 (file)
@@ -15,9 +15,7 @@ set minplayers 0 "fill server with bots to reach this number of players in teaml
 set minplayers_per_team 0 "fill server with bots to reach this number of players per team (if bot_number is not enough)"
 
 // restart server if all players hit "ready"-button
-set sv_ready_restart 0 "allow a map to be restarted once all players pressed the \"ready\" button"
 set sv_ready_restart_after_countdown 0 "reset players and map items after the countdown ended, instead of at the beginning of the countdown"
-set sv_ready_restart_repeatable 0 "allows the players to restart the game as often as needed"
 
 alias sv_hook_readyrestart