From: Rudolf Polzer Date: Fri, 18 Oct 2013 01:15:57 +0000 (+0200) Subject: fix g_warmup_allguns 1 X-Git-Tag: xonotic-v0.8.0~276 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=39c6fe854bc866de4089c9a48a7db488296285db;p=xonotic%2Fxonotic-data.pk3dir.git fix g_warmup_allguns 1 --- 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); }