From: bones_was_here Date: Mon, 26 Sep 2022 05:20:48 +0000 (+1000) Subject: Misc cleanups for warmup and welcome message X-Git-Tag: xonotic-v0.8.6~348^2~16 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=103d3525a1dde2c3bed5281808f748417460f7c3;p=xonotic%2Fxonotic-data.pk3dir.git Misc cleanups for warmup and welcome message --- diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index 68e7312c7..5209aa07d 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -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); diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 22f0438f4..b35b7f3db 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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); diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 12e130c9e..8d2debdd5 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -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); diff --git a/qcsrc/server/command/vote.qh b/qcsrc/server/command/vote.qh index 7c96223a7..88e311beb 100644 --- a/qcsrc/server/command/vote.qh +++ b/qcsrc/server/command/vote.qh @@ -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(); diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index bd713ecd0..50a6347a0 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -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;