]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow assault to override sv_ready_restart_after_countdown setting, like for g_warmup...
authorterencehill <piuntn@gmail.com>
Fri, 2 Feb 2018 13:56:12 +0000 (14:56 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 2 Feb 2018 13:56:12 +0000 (14:56 +0100)
qcsrc/server/autocvars.qh
qcsrc/server/client.qc
qcsrc/server/command/vote.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/weapons/weaponsystem.qc

index 80da3f403ac97c025274b109d1ede8f5c8c8ea83..664c307c83542e3e08d0ce5d843d5fd65619dbd4 100644 (file)
@@ -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;
index 3333c04e49180286b6ef8806c91aa410baf0de1e..7d7ab9e71851fe67488f2b93047c214a4cbddda8 100644 (file)
@@ -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;
index 1a826c6f142daf0164d83a7a27f59b37c09d9820..1fef5ff7fbe0ff5dca04a21d6041e9ba4a099324 100644 (file)
@@ -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();
 }
 
index 1dd3526dd48c435eaa00ade8bc1a0047b767079a..34f7d608001e04b969b6b41a0ab31cee3fb6184c 100644 (file)
@@ -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");
index 50861c32f7d005bf40435df9449128e62eb1d05e..70e2669184bb30d3e852f9e7c7bed02478c470a1 100644 (file)
@@ -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)
index 2f6fcb68d7213cbafc508343d377da932944ad0a..05f707159fed239a79303a76eeea1f5f842878b4 100644 (file)
@@ -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;