]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Misc cleanups for warmup and welcome message
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 26 Sep 2022 05:20:48 +0000 (15:20 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Mon, 26 Sep 2022 05:20:48 +0000 (15:20 +1000)
qcsrc/client/hud/panel/timer.qc
qcsrc/client/main.qc
qcsrc/server/command/vote.qc
qcsrc/server/command/vote.qh
qcsrc/server/world.qc

index 68e7312c7a5ba881ee1f45a000e91f64219ea7fb..5209aa07d07662f2996ea5086f14fe712a2aeaf3 100644 (file)
@@ -73,15 +73,9 @@ void HUD_Timer()
        // Use real or frozen time and get the time limit
        curtime = (intermission_time ? intermission_time : time);
        if(warmup_stage)
-       {
                timelimit = STAT(WARMUP_TIMELIMIT);
-               if(timelimit == 0)
-                       timelimit = STAT(TIMELIMIT) * 60;
-       }
        else
-       {
                timelimit = STAT(TIMELIMIT) * 60;
-       }
 
        // Calculate time left
        timeleft = HUD_Timer_TimeLeft(curtime, STAT(GAMESTARTTIME), timelimit);
index 22f0438f411fd76aa4dda07953d3e09c3f1345ef..b35b7f3db63b1c11717b0e919b0675c9c71d33df 100644 (file)
@@ -1420,19 +1420,16 @@ bool net_handle_ServerWelcome()
        }
 
        strcpy(hostname, ReadString());
-
        string hostversion = ReadString();
        bool version_mismatch = ReadByte();
        bool version_check = ReadByte();
-       string ver = GetVersionMessage(hostversion, version_mismatch, version_check);
-
        string modifications = translate_modifications(ReadString());
        string weaponarena_list = translate_weaponarena(ReadString());
        string cache_mutatormsg = ReadString();
        string motd = ReadString();
 
-       string msg = "";
-       msg = strcat(msg, ver);
+       string msg = GetVersionMessage(hostversion, version_mismatch, version_check);
+
        msg = strcat(msg, "^8\n\n", strcat(_("Gametype:"), " ^1", MapInfo_Type_ToText(gametype)), "^8\n");
 
        modifications = cons_mid(modifications, ", ", weaponarena_list);
index 12e130c9e80ddf25aa17ba4da4583762ddcb95bd..8d2debdd50a0f49db13fa5682208cd34e80f1a9a 100644 (file)
@@ -507,15 +507,14 @@ void ReadyRestart(bool forceWarmupEnd)
 void ReadyCount()
 {
        float ready_needed_factor, ready_needed_count;
-       float t_ready = 0, t_players = 0;
+       float t_players = 0;
+       readycount = 0;
 
        FOREACH_CLIENT(IS_REAL_CLIENT(it) && (IS_PLAYER(it) || INGAME_JOINED(it)), {
                ++t_players;
-               if (it.ready) ++t_ready;
+               if (it.ready) ++readycount;
        });
 
-       readycount = t_ready;
-
        Nagger_ReadyCounted();
 
        ready_needed_factor = bound(0.5, cvar("g_warmup_majority_factor"), 0.999);
index 7c96223a71318d736040fa6fa5d091275843c564..88e311beb670eb4581deec4f2ff2b12a72656af5 100644 (file)
@@ -62,11 +62,11 @@ void VoteCommand(int request, entity caller, int argc, string vote_command);
 // warmup and nagger stuff
 const float RESTART_COUNTDOWN = 10;
 entity nagger;
-float readycount;                  // amount of players who are ready
+int readycount;                    // amount of players who are ready
 .float ready;                      // flag for if a player is ready
 .float last_ready;                 // last ready time for anti-spam
 .int team_saved;                   // team number to restore upon map reset
-.void(entity this) reset;             // if set, an entity is reset using this
+.void(entity this) reset;          // if set, an entity is reset using this
 .void(entity this) reset2;         // if set, an entity is reset using this (after calling ALL the reset functions for other entities)
 void reset_map(float dorespawn, bool is_fake_round_start);
 void ReadyCount();
index bd713ecd09cea6562c5f41e6eef7b06455eb7641..50a6347a04ff301b6c9dd16896553176769d28a5 100644 (file)
@@ -467,7 +467,6 @@ void cvar_changes_init()
                BADCVAR("g_start_delay");
                BADCVAR("g_superspectate");
                BADCVAR("g_tdm_teams_override");
-               BADCVAR("g_warmup");
                BADCVAR("g_weapon_stay"); BADPRESUFFIX("g_", "_weapon_stay");
                BADCVAR("hostname");
                BADCVAR("log_file");
@@ -507,7 +506,7 @@ void cvar_changes_init()
                BADVALUE("sys_ticrate", "0.0333333");
                BADCVAR("teamplay_mode");
                BADCVAR("timelimit_override");
-               BADPREFIX("g_warmup_");
+               BADPREFIX("g_warmup");
                BADPREFIX("sv_info_");
                BADPREFIX("sv_ready_restart_");
 
@@ -826,7 +825,7 @@ spawnfunc(worldspawn)
        GameRules_limit_fallbacks();
 
        if(warmup_limit == 0)
-               warmup_limit = (autocvar_timelimit > 0) ? autocvar_timelimit * 60 : autocvar_timelimit;
+               warmup_limit = autocvar_timelimit * 60;
 
        player_count = 0;
        bot_waypoints_for_items = autocvar_g_waypoints_for_items;