]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'terencehill/assault_fix' into 'master'
authorMario <zacjardine@y7mail.com>
Thu, 8 Feb 2018 00:21:35 +0000 (00:21 +0000)
committerMario <zacjardine@y7mail.com>
Thu, 8 Feb 2018 00:21:35 +0000 (00:21 +0000)
Assault fix

Closes #1944

See merge request xonotic/xonotic-data.pk3dir!523

qcsrc/server/autocvars.qh
qcsrc/server/client.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc
qcsrc/server/weapons/weaponsystem.qc

index 80da3f403ac97c025274b109d1ede8f5c8c8ea83..847573135eae56c16039a00deb621b3c3d1f548b 100644 (file)
@@ -324,9 +324,6 @@ string autocvar_sv_motd;
 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;
 float autocvar_sv_spectator_speed_multiplier;
index 4159f0bb4bfddbbf35513ceecef0d6ab0b774c3c..16908fcd3c90b740098d6c62c286f516ec099a7a 100644 (file)
@@ -582,14 +582,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 09a308ad5c64d6a1001fb31754d2a8d0721f89e0..088925f100f2f3f47499a4be5a72bcac7861bf15 100644 (file)
@@ -239,9 +239,9 @@ void ClientCommand_ready(entity caller, float request)  // todo: anti-spam for t
                {
                        if (IS_CLIENT(caller))
                        {
-                               if (warmup_stage || autocvar_sv_ready_restart || g_race_qualifying == 2)
+                               if (warmup_stage || sv_ready_restart || g_race_qualifying == 2)
                                {
-                                       if (!readyrestart_happened || autocvar_sv_ready_restart_repeatable)
+                                       if (!readyrestart_happened || sv_ready_restart_repeatable)
                                        {
                                                if (time < game_starttime) // game is already restarting
                                                        return;
index c9a5550ba81562b7fb36075200ab21aed39f6b68..7ed7d6b4eae3435478c111dde86799b25afdf77a 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 e9cf6ee286a7d8831806504435737977436d8e08..df94c778112f0ec6cf5bf19508afb4de55c0997c 100644 (file)
@@ -13,6 +13,10 @@ float g_warmup_allow_timeout;
 float warmup_stage;
 float g_jetpack;
 
+bool sv_ready_restart;
+bool sv_ready_restart_after_countdown;
+bool sv_ready_restart_repeatable;
+
 float sv_clones;
 float sv_foginterval;
 
index 1dd3526dd48c435eaa00ade8bc1a0047b767079a..8a32b9b5bddf8c9ff71e031f6857fecbc86cb812 100644 (file)
@@ -235,6 +235,9 @@ void readlevelcvars()
        sv_maxidle_slots_countbots = cvar("sv_maxidle_slots_countbots");
        sv_autotaunt = cvar("sv_autotaunt");
        sv_taunt = cvar("sv_taunt");
+       sv_ready_restart = cvar("sv_ready_restart");
+       sv_ready_restart_after_countdown = cvar("sv_ready_restart_after_countdown");
+       sv_ready_restart_repeatable = cvar("sv_ready_restart_repeatable");
 
        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 c7e365614b63e46fedd11c6a58e714903d1c9fb3..809db42710815711c3da5177035c0a1cc1affe2c 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;