]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix g_warmup_allguns 1
authorRudolf Polzer <divverent@xonotic.org>
Fri, 18 Oct 2013 01:15:57 +0000 (03:15 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 18 Oct 2013 01:15:57 +0000 (03:15 +0200)
qcsrc/server/cl_client.qc
qcsrc/server/g_damage.qc
qcsrc/server/miscfunctions.qc

index d53fe2082309958f83602af3d5556a42285367ee..1ab2b7ab512ea82d0b7368fdec781a2124d97a73 100644 (file)
@@ -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
                {
index c01cddd216a45bbdee98ba5c4c7e57767aaacd29..15b7a62bf2e0f0f9e53ffe673c6cd3c7436e42f1 100644 (file)
@@ -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;
 
index 0b5b42781229f0df535621e4b373a0e36302329a..91e922869ba4a69ca0117416853870b8ccbd4749 100644 (file)
@@ -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);
        }