From c19abe332eb1f31e76a32b584c9993cdd02b0496 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 2 Feb 2018 14:56:12 +0100 Subject: [PATCH] Allow assault to override sv_ready_restart_after_countdown setting, like for g_warmup; it fixes #1944 "Assault incompatible with sv_ready_restart_after_countdown" --- qcsrc/server/autocvars.qh | 1 - qcsrc/server/client.qc | 5 +++-- qcsrc/server/command/vote.qc | 8 ++++---- qcsrc/server/miscfunctions.qh | 2 ++ qcsrc/server/mutators/mutator/gamemode_assault.qc | 3 ++- qcsrc/server/weapons/weaponsystem.qc | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 80da3f403..664c307c8 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -325,7 +325,6 @@ bool autocvar_sv_precacheplayermodels; //float autocvar_sv_precacheweapons; // WEAPONTODO? bool autocvar_sv_q3acompat_machineshotgunswap; bool autocvar_sv_ready_restart; -bool autocvar_sv_ready_restart_after_countdown; bool autocvar_sv_ready_restart_repeatable; bool autocvar_sv_servermodelsonly; int autocvar_sv_spectate; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 3333c04e4..7d7ab9e71 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -577,14 +577,15 @@ void PutPlayerInServer(entity this) this.pauserothealth_finished = time + autocvar_g_balance_pause_health_rot_spawn; this.pauserotfuel_finished = time + autocvar_g_balance_pause_fuel_rot_spawn; this.pauseregen_finished = time + autocvar_g_balance_pause_health_regen_spawn; - // extend the pause of rotting if client was reset at the beginning of the countdown - if (!autocvar_sv_ready_restart_after_countdown && time < game_starttime) { // TODO why is this cvar NOTted? + if (!sv_ready_restart_after_countdown && time < game_starttime) + { float f = game_starttime - time; this.spawnshieldtime += f; this.pauserotarmor_finished += f; this.pauserothealth_finished += f; this.pauseregen_finished += f; } + this.damageforcescale = 2; this.death_time = 0; this.respawn_flags = 0; diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 1a826c6f1..1fef5ff7f 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -452,7 +452,7 @@ void ReadyRestart_force() } // initiate the restart-countdown-announcer entity - if (autocvar_sv_ready_restart_after_countdown) + if (sv_ready_restart_after_countdown) { entity restart_timer = new_pure(restart_timer); setthink(restart_timer, ReadyRestart_think); @@ -464,8 +464,8 @@ void ReadyRestart_force() { FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { CS(it).allowed_timeouts = autocvar_sv_timeout_number; }); } - // reset map immediately if this cvar is not set - if (!autocvar_sv_ready_restart_after_countdown) reset_map(true); + + if (!sv_ready_restart_after_countdown) reset_map(true); if (autocvar_sv_eventlog) GameLogEcho(":restart"); } @@ -476,7 +476,7 @@ void ReadyRestart() // Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off! // Otherwise scores could be manipulated during the countdown. - if (!autocvar_sv_ready_restart_after_countdown) Score_ClearAll(); + if (!sv_ready_restart_after_countdown) Score_ClearAll(); ReadyRestart_force(); } diff --git a/qcsrc/server/miscfunctions.qh b/qcsrc/server/miscfunctions.qh index 1dd3526dd..34f7d6080 100644 --- a/qcsrc/server/miscfunctions.qh +++ b/qcsrc/server/miscfunctions.qh @@ -210,6 +210,7 @@ float warmup_start_ammo_fuel; float warmup_start_health; float warmup_start_armorvalue; float g_weapon_stay; +bool sv_ready_restart_after_countdown; float want_weapon(entity weaponinfo, float allguns); // WEAPONTODO: what still needs done? void readplayerstartcvars(); @@ -235,6 +236,7 @@ void readlevelcvars() sv_maxidle_slots_countbots = cvar("sv_maxidle_slots_countbots"); sv_autotaunt = cvar("sv_autotaunt"); sv_taunt = cvar("sv_taunt"); + sv_ready_restart_after_countdown = cvar("sv_ready_restart_after_countdown"); warmup_stage = cvar("g_warmup"); warmup_limit = cvar("g_warmup_limit"); diff --git a/qcsrc/server/mutators/mutator/gamemode_assault.qc b/qcsrc/server/mutators/mutator/gamemode_assault.qc index 50861c32f..70e266918 100644 --- a/qcsrc/server/mutators/mutator/gamemode_assault.qc +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qc @@ -591,8 +591,9 @@ MUTATOR_HOOKFUNCTION(as, CheckRules_World) MUTATOR_HOOKFUNCTION(as, ReadLevelCvars) { - // no assault warmups + // incompatible warmup_stage = 0; + sv_ready_restart_after_countdown = 0; } MUTATOR_HOOKFUNCTION(as, OnEntityPreSpawn) diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 2f6fcb68d..05f707159 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -418,7 +418,7 @@ void weapon_thinkf(entity actor, .entity weaponentity, WFRAME fr, float t, void( bool forbidWeaponUse(entity player) { - if (time < game_starttime && !autocvar_sv_ready_restart_after_countdown) return true; + if (time < game_starttime && !sv_ready_restart_after_countdown) return true; if (player.player_blocked) return true; if (game_stopped) return true; if (STAT(FROZEN, player)) return true; -- 2.39.2