From: Rudolf Polzer Date: Fri, 10 Dec 2010 23:42:30 +0000 (+0100) Subject: fix start ammo in weaponarena X-Git-Tag: xonotic-v0.1.0preview~63 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4d5958d6a729a6d13b72ce316d24a780d7433830;p=xonotic%2Fxonotic-data.pk3dir.git fix start ammo in weaponarena --- diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 8e052e837..11c97cc11 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -981,16 +981,23 @@ void readplayerstartcvars() if (g_weaponarena) { start_weapons = g_weaponarena; - if (g_weaponarena & (WEPBIT_GRENADE_LAUNCHER | WEPBIT_MINE_LAYER | WEPBIT_HAGAR | WEPBIT_ROCKET_LAUNCHER)) - start_ammo_rockets = 999; - if (g_weaponarena & WEPBIT_SHOTGUN) - start_ammo_shells = 999; - if (g_weaponarena & (WEPBIT_ELECTRO | WEPBIT_CRYLINK | WEPBIT_NEX | WEPBIT_MINSTANEX | WEPBIT_HLAC | WEPBIT_HOOK)) - start_ammo_cells = 999; - if (g_weaponarena & (WEPBIT_UZI | WEPBIT_CAMPINGRIFLE)) - start_ammo_nails = 999; - if (g_weaponarena & WEPBIT_HOOK) - start_ammo_fuel = 999; + for (j = WEP_FIRST; j <= WEP_LAST; ++j) + { + e = get_weaponinfo(j); + if(start_weapons & e.weapons) + { + if(e.items & IT_ROCKETS) + start_ammo_rockets = 999; + if(e.items & IT_SHELLS) + start_ammo_shells = 999; + if(e.items & IT_CELLS) + start_ammo_cells = 999; + if(e.items & IT_NAILS) + start_ammo_nails = 999; + if(e.items & IT_FUEL) + start_ammo_fuel = 999; + } + } start_items |= IT_UNLIMITED_AMMO; } else if (g_minstagib) diff --git a/qcsrc/server/w_seeker.qc b/qcsrc/server/w_seeker.qc index 4ab7f4f22..eb64dddd8 100644 --- a/qcsrc/server/w_seeker.qc +++ b/qcsrc/server/w_seeker.qc @@ -158,7 +158,7 @@ void Seeker_Fire_Missile(vector f_diff) { local entity missile; - if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO) + if not(self.items & IT_UNLIMITED_WEAPON_AMMO) self.ammo_rockets = self.ammo_rockets - autocvar_g_balance_seeker_missile_ammo; makevectors(self.v_angle);