From 39c6fe854bc866de4089c9a48a7db488296285db Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 18 Oct 2013 03:15:57 +0200 Subject: [PATCH] fix g_warmup_allguns 1 --- qcsrc/server/cl_client.qc | 6 +----- qcsrc/server/g_damage.qc | 2 +- qcsrc/server/miscfunctions.qc | 8 ++++++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index d53fe2082..1ab2b7ab5 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -439,11 +439,7 @@ void PutClientInServer (void) self.ammo_fuel = warmup_start_ammo_fuel; self.health = warmup_start_health; self.armorvalue = warmup_start_armorvalue; - - if(g_warmup_allguns == 2) - self.weapons = warmup_start_weapons; - else if(g_warmup_allguns == 1) - self.weapons = (warmup_start_weapons & (weaponsInMap | start_weapons)); + self.weapons = WARMUP_START_WEAPONS; } else { diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index c01cddd21..15b7a62bf 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -128,7 +128,7 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype) } if(warmup_stage) - GiveFrags_randomweapons.weapons = warmup_start_weapons; + GiveFrags_randomweapons.weapons = WARMUP_START_WEAPONS; else GiveFrags_randomweapons.weapons = start_weapons; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 0b5b42781..91e922869 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -615,6 +615,7 @@ float start_armorvalue; WepSet warmup_start_weapons; WepSet warmup_start_weapons_default; WepSet warmup_start_weapons_defaultmask; +#define WARMUP_START_WEAPONS ((g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons) float warmup_start_ammo_shells; float warmup_start_ammo_nails; float warmup_start_ammo_rockets; @@ -834,7 +835,7 @@ void readplayerstartcvars() for (i = WEP_FIRST; i <= WEP_LAST; ++i) { e = get_weaponinfo(i); - float w = want_weapon("g_start_weapon_", e, cvar("g_warmup_allguns")); + float w = want_weapon("g_start_weapon_", e, g_warmup_allguns); if(w & 1) warmup_start_weapons |= WepSet_FromWeapon(i); if(w & 2) @@ -858,10 +859,13 @@ void readplayerstartcvars() warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable")); } + WepSet precache_weapons = start_weapons; + if (g_warmup_allguns != 1) + precache_weapons |= warmup_start_weapons; for (i = WEP_FIRST; i <= WEP_LAST; ++i) { e = get_weaponinfo(i); - if((start_weapons | warmup_start_weapons) & WepSet_FromWeapon(i)) + if(precache_weapons & WepSet_FromWeapon(i)) weapon_action(i, WR_PRECACHE); } -- 2.39.2