]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
remove IT_UNLIMITED_BOTH
authorMartin Taibr <taibr.martin@gmail.com>
Mon, 2 Sep 2019 12:32:32 +0000 (14:32 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Mon, 2 Sep 2019 12:32:32 +0000 (14:32 +0200)
31 files changed:
qcsrc/client/hud/panel/ammo.qc
qcsrc/client/hud/panel/weapons.qc
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc
qcsrc/common/items/item.qh
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/mutators/mutator/instagib/sv_instagib.qc
qcsrc/common/mutators/mutator/nix/sv_nix.qc
qcsrc/common/mutators/mutator/overkill/okhmg.qc
qcsrc/common/mutators/mutator/overkill/okmachinegun.qc
qcsrc/common/mutators/mutator/overkill/oknex.qc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/common/physics/player.qc
qcsrc/common/t_items.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/server/bot/default/navigation.qc
qcsrc/server/client.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/tests.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/weaponsystem.qc

index bd9aa1a21ca53afe3837d12bdf1fef3771ac4940..95ceced82c74d7ca6a39adc2084de9e950c85a2c 100644 (file)
@@ -177,7 +177,7 @@ void HUD_Ammo()
 
        Weapon wep = wepent.switchweapon;
        int i;
-       bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_WEAPON_AMMO);
+       bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_AMMO);
        row = column = 0;
        if(autocvar_hud_panel_ammo_onlycurrent)
        {
index ac32e23cb9373195df72860661d9dcce8f2d3f7b..fef3eec09e74d7a487c48bcabe702021256cb50b 100644 (file)
@@ -63,7 +63,7 @@ void HUD_Weapons()
        float when = max(1, autocvar_hud_panel_weapons_complainbubble_time);
        float fadetime = max(0, autocvar_hud_panel_weapons_complainbubble_fadetime);
 
-       bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_WEAPON_AMMO);
+       bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_AMMO);
 
        vector weapon_pos, weapon_size = '0 0 0';
        vector color;
index c966e16d8059954fdd80058ed17d72e2edcac1d1..408a14e0d87fbac00a3dfcc11bd6292997149fe3 100644 (file)
@@ -333,7 +333,7 @@ MUTATOR_HOOKFUNCTION(ca, GiveFragsForKill, CBC_ORDER_FIRST)
 
 MUTATOR_HOOKFUNCTION(ca, SetStartItems)
 {
-       start_items       &= ~IT_UNLIMITED_BOTH;
+       start_items       &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
        start_health       = warmup_start_health       = cvar("g_lms_start_health");
        start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
        start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");
index ed0209a7a7bf6a284dbedcdafe14093614ea055b..54f6268e36da53d537e2effef2c5c72c62afadbf 100644 (file)
@@ -549,7 +549,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
 
 MUTATOR_HOOKFUNCTION(ft, SetStartItems)
 {
-       start_items &= ~IT_UNLIMITED_BOTH;
+       start_items &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
        //start_health       = warmup_start_health       = cvar("g_lms_start_health");
        //start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
        start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");
index 6df1cb130943fe927f84f44a9670ce534015c316..aceb66e0310db714e640c16250b7bcd8d4a547c5 100644 (file)
@@ -323,7 +323,7 @@ MUTATOR_HOOKFUNCTION(lms, GiveFragsForKill)
 
 MUTATOR_HOOKFUNCTION(lms, SetStartItems)
 {
-       start_items &= ~IT_UNLIMITED_BOTH;
+       start_items &= ~(IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS);
        start_health       = warmup_start_health       = cvar("g_lms_start_health");
        start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
        start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");
index 1f01790d24b26ea6609705ea4c07031aad7207e5..8ba0096713342a7c7a5364b95ffe8fb58674c2e2 100644 (file)
@@ -11,7 +11,7 @@
 #include <server/items.qh>
 #endif
 
-const int IT_UNLIMITED_WEAPON_AMMO             =  BIT(0); // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
+const int IT_UNLIMITED_AMMO                    =  BIT(0); // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
 const int IT_UNLIMITED_SUPERWEAPONS            =  BIT(1); // when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
 
 const int IT_JETPACK                           =  BIT(2); // actual item
@@ -44,8 +44,7 @@ const int IT_SUPERWEAPON                              = BIT(21); // suit
 const int IT_STRENGTH                                  = BIT(22);
 
 // item masks
-const int IT_UNLIMITED_BOTH                    = IT_UNLIMITED_WEAPON_AMMO | IT_UNLIMITED_SUPERWEAPONS;
-const int IT_PICKUPMASK                        = IT_UNLIMITED_BOTH | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
+const int IT_PICKUPMASK                        = IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
 
 #ifdef SVQC
 const .float strength_finished = _STAT(STRENGTH_FINISHED);
index d25c3151f7edac55ee34808e30763b2f8fed6f27..7dc4461df87b5f99c4aa1ed41555072202da91e5 100644 (file)
@@ -212,7 +212,7 @@ float buff_Available(entity buff)
 {
        if (buff == BUFF_Null)
                return false;
-       if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_WEAPON_AMMO) || (start_items & IT_UNLIMITED_BOTH) || (cvar("g_melee_only"))))
+       if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_AMMO) || cvar("g_melee_only")))
                return false;
        if (buff == BUFF_VAMPIRE && cvar("g_vampire"))
                return false;
@@ -918,8 +918,8 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink)
 
                BUFF_ONADD(BUFF_AMMO)
                {
-                       player.buff_ammo_prev_infitems = (player.items & IT_UNLIMITED_WEAPON_AMMO);
-                       player.items |= IT_UNLIMITED_WEAPON_AMMO;
+                       player.buff_ammo_prev_infitems = (player.items & IT_UNLIMITED_AMMO);
+                       player.items |= IT_UNLIMITED_AMMO;
 
                        if(STAT(BUFFS, player) & BUFF_AMMO.m_itemid)
                        {
@@ -937,9 +937,9 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink)
                BUFF_ONREM(BUFF_AMMO)
                {
                        if(player.buff_ammo_prev_infitems)
-                               player.items |= IT_UNLIMITED_WEAPON_AMMO;
+                               player.items |= IT_UNLIMITED_AMMO;
                        else
-                               player.items &= ~IT_UNLIMITED_WEAPON_AMMO;
+                               player.items &= ~IT_UNLIMITED_AMMO;
 
                        if(STAT(BUFFS, player) & BUFF_AMMO.m_itemid)
                        {
index 63f3182ea6ba4746abb57d5491c5c97d29294adc..c4f4b5d00cd861d9c717beb3fcc2edeca2157346 100644 (file)
@@ -82,7 +82,7 @@ void instagib_ammocheck(entity this)
 
        if(IS_DEAD(this) || game_stopped)
                instagib_stop_countdown(this);
-       else if (GetResource(this, RES_CELLS) > 0 || (this.items & IT_UNLIMITED_WEAPON_AMMO) || (this.flags & FL_GODMODE))
+       else if (GetResource(this, RES_CELLS) > 0 || (this.items & IT_UNLIMITED_AMMO) || (this.flags & FL_GODMODE))
                instagib_stop_countdown(this);
        else if(autocvar_g_rm && autocvar_g_rm_laser)
        {
index efe8ee3aedf2449988527ca916cc77bc2055044e..7214a699e1122e759026f2b5995ee4a99305a943 100644 (file)
@@ -140,7 +140,7 @@ void NIX_GiveCurrentWeapon(entity this)
                SetResource(this, RES_CELLS, 0);
                SetResource(this, RES_PLASMA, 0);
                SetResource(this, RES_FUEL, 0);
-               if(this.items & IT_UNLIMITED_WEAPON_AMMO)
+               if(this.items & IT_UNLIMITED_AMMO)
                {
                        switch (wpn.ammo_type)
                        {
@@ -193,7 +193,7 @@ void NIX_GiveCurrentWeapon(entity this)
                        Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_NIX_COUNTDOWN, nix_nextweapon, dt);
        }
 
-       if(!(this.items & IT_UNLIMITED_WEAPON_AMMO) && time > this.nix_nextincr)
+       if(!(this.items & IT_UNLIMITED_AMMO) && time > this.nix_nextincr)
        {
                switch (wpn.ammo_type)
                {
index bee61f2fea54516c00e7be4088be64b09a8fdab4..df55fb88c42a4663b96b9aaa5a6f3b61d908692f 100644 (file)
@@ -18,7 +18,7 @@ void W_OverkillHeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity
                return;
        }
 
-       if((!thiswep.wr_checkammo1(thiswep, actor, weaponentity) && !(actor.items & IT_UNLIMITED_WEAPON_AMMO)) || (!(actor.items & IT_SUPERWEAPON) && !(actor.items & IT_UNLIMITED_SUPERWEAPONS)))
+       if((!thiswep.wr_checkammo1(thiswep, actor, weaponentity) && !(actor.items & IT_UNLIMITED_AMMO)) || (!(actor.items & IT_SUPERWEAPON) && !(actor.items & IT_UNLIMITED_SUPERWEAPONS)))
        {
                W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
                w_ready(thiswep, actor, weaponentity, fire);
index f8dfa89fe5b5748e72bea985b7349315f1c56780..768e364a78535f8274516388f47519ed4294da21 100644 (file)
@@ -13,7 +13,7 @@ void W_OverkillMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weap
        }
 
        if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity))
-       if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+       if(!(actor.items & IT_UNLIMITED_AMMO))
        {
                W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
                w_ready(thiswep, actor, weaponentity, fire);
index cbcc285a54585382d61e0618fa7a2269a8985860..83a3a3cc052c3e9adbaf0143af71242def1946a5 100644 (file)
@@ -221,7 +221,7 @@ METHOD(OverkillNex, wr_think, void(entity thiswep, entity actor, .entity weapone
        //                              if(fire & 2) // only eat ammo when the button is pressed
        //                              {
        //                                      dt = min(dt, (1 - actor.(weaponentity).oknex_charge) / WEP_CVAR(oknex, charge_rate));
-       //                                      if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+       //                                      if(!(actor.items & IT_UNLIMITED_AMMO))
        //                                      {
        //                                              // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
        //                                              if(autocvar_g_balance_vortex_reload_ammo)
index dbcda2d59e1db202a53f5d33cb5a4419609b2731..8176669dea78164c5b7bc0e8fecc9e8f4febf8a2 100644 (file)
@@ -276,7 +276,7 @@ MUTATOR_HOOKFUNCTION(ok, SetStartItems, CBC_ORDER_LAST)
 
        // this gives unlimited ammo (the 4 types) but not fuel
        // using `g_use_ammunition` instead gives also fuel which is unnecessary and distracting in the HUD
-       start_items |= IT_UNLIMITED_WEAPON_AMMO;
+       start_items |= IT_UNLIMITED_AMMO;
 
        start_weapons = warmup_start_weapons = ok_start_items;
 }
index acef8c97ad183273d5e944e5c119838bc4d6eb54..251bf995aaf9ae966bd09da2b80fca977398948e 100644 (file)
@@ -472,7 +472,7 @@ void CheckPlayerJump(entity this)
 
                bool air_jump = !playerjump || M_ARGV(2, bool);
                bool activate = JETPACK_JUMP(this) && air_jump && PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_JETPACK(this);
-               bool has_fuel = !PHYS_JETPACK_FUEL(this) || PHYS_AMMO_FUEL(this) || (ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO);
+               bool has_fuel = !PHYS_JETPACK_FUEL(this) || PHYS_AMMO_FUEL(this) || (ITEMS_STAT(this) & IT_UNLIMITED_AMMO);
 
                if (!(ITEMS_STAT(this) & ITEM_Jetpack.m_itemid)) { }
                else if (this.jetpack_stopped) { }
@@ -785,7 +785,7 @@ void PM_jetpack(entity this, float maxspd_mod, float dt)
        wishvel_z = (wishvel_z - PHYS_GRAVITY(this)) * fz + PHYS_GRAVITY(this);
 
        fvel = min(1, vlen(wishvel) / best);
-       if (PHYS_JETPACK_FUEL(this) && !(ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO))
+       if (PHYS_JETPACK_FUEL(this) && !(ITEMS_STAT(this) & IT_UNLIMITED_AMMO))
                f = min(1, PHYS_AMMO_FUEL(this) / (PHYS_JETPACK_FUEL(this) * dt * fvel));
        else
                f = 1;
@@ -798,7 +798,7 @@ void PM_jetpack(entity this, float maxspd_mod, float dt)
                UNSET_ONGROUND(this);
 
 #ifdef SVQC
-               if (!(ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO))
+               if (!(ITEMS_STAT(this) & IT_UNLIMITED_AMMO))
                        TakeResource(this, RES_FUEL, PHYS_JETPACK_FUEL(this) * dt * fvel * f);
 
                ITEMS_STAT(this) |= IT_USING_JETPACK;
index 663f14be89fd68a01422aa7416a6d7651eded7d8..a1476ae14c9a13d0e9158f0f303db2676b5d47c0 100644 (file)
@@ -1477,9 +1477,6 @@ void target_items_use(entity this, entity actor, entity trigger)
 
 spawnfunc(target_items)
 {
-       int n;
-       string s;
-
        this.use = target_items_use;
        if(!this.strength_finished)
                this.strength_finished = autocvar_g_balance_powerup_strength_time;
@@ -1488,7 +1485,7 @@ spawnfunc(target_items)
        if(!this.superweapons_finished)
                this.superweapons_finished = autocvar_g_balance_superweapons_time;
 
-       n = tokenize_console(this.netname);
+       int n = tokenize_console(this.netname);
        if(argv(0) == "give")
        {
                this.netname = substring(this.netname, argv_start_index(1), argv_end_index(-1) - argv_start_index(1));
@@ -1497,8 +1494,9 @@ spawnfunc(target_items)
        {
                for(int j = 0; j < n; ++j)
                {
-                       if     (argv(j) == "unlimited_ammo")         this.items |= IT_UNLIMITED_BOTH;
-                       else if(argv(j) == "unlimited_weapon_ammo")  this.items |= IT_UNLIMITED_WEAPON_AMMO;
+                       // this is from a time when unlimited superweapons were handled together with ammo in some parts of the code
+                       if     (argv(j) == "unlimited_ammo")         this.items |= IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS;
+                       else if(argv(j) == "unlimited_weapon_ammo")  this.items |= IT_UNLIMITED_AMMO;
                        else if(argv(j) == "unlimited_superweapons") this.items |= IT_UNLIMITED_SUPERWEAPONS;
                        else if(argv(j) == "strength")               this.items |= ITEM_Strength.m_itemid;
                        else if(argv(j) == "invincible")             this.items |= ITEM_Shield.m_itemid;
@@ -1509,7 +1507,7 @@ spawnfunc(target_items)
                        {
                                FOREACH(Buffs, it != BUFF_Null,
                                {
-                                       s = Buff_UndeprecateName(argv(j));
+                                       string s = Buff_UndeprecateName(argv(j));
                                        if(s == it.netname)
                                        {
                                                STAT(BUFFS, this) |= (it.m_itemid);
@@ -1519,7 +1517,7 @@ spawnfunc(target_items)
                                        }
                                });
                                FOREACH(Weapons, it != WEP_Null, {
-                                       s = W_UndeprecateName(argv(j));
+                                       string s = W_UndeprecateName(argv(j));
                                        if(s == it.netname)
                                        {
                                                STAT(WEAPONS, this) |= (it.m_wepset);
@@ -1559,7 +1557,7 @@ spawnfunc(target_items)
                }
 
                this.netname = "";
-               this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & IT_UNLIMITED_WEAPON_AMMO), "unlimited_weapon_ammo");
+               this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & IT_UNLIMITED_AMMO), "unlimited_weapon_ammo");
                this.netname = sprintf("%s %s%d %s", this.netname, itemprefix, boolean(this.items & IT_UNLIMITED_SUPERWEAPONS), "unlimited_superweapons");
                this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, this.strength_finished * boolean(this.items & ITEM_Strength.m_itemid), "strength");
                this.netname = sprintf("%s %s%d %s", this.netname, valueprefix, this.invincible_finished * boolean(this.items & ITEM_Shield.m_itemid), "invincible");
@@ -1763,7 +1761,7 @@ float GiveItems(entity e, float beginarg, float endarg)
                                got += GiveValue(e, strength_finished, op, val);
                                got += GiveValue(e, invincible_finished, op, val);
                                got += GiveValue(e, superweapons_finished, op, val);
-                               got += GiveBit(e, items, IT_UNLIMITED_BOTH, op, val);
+                               got += GiveBit(e, items, IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS, op, val);
                        case "all":
                                got += GiveBit(e, items, ITEM_Jetpack.m_itemid, op, val);
                                got += GiveResourceValue(e, RES_HEALTH, op, val);
@@ -1781,10 +1779,11 @@ float GiveItems(entity e, float beginarg, float endarg)
                                got += GiveResourceValue(e, RES_FUEL, op, val);
                                break;
                        case "unlimited_ammo":
-                               got += GiveBit(e, items, IT_UNLIMITED_BOTH, op, val);
+                               // this is from a time when unlimited superweapons were handled together with ammo in some parts of the code
+                               got += GiveBit(e, items, IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS, op, val);
                                break;
                        case "unlimited_weapon_ammo":
-                               got += GiveBit(e, items, IT_UNLIMITED_WEAPON_AMMO, op, val);
+                               got += GiveBit(e, items, IT_UNLIMITED_AMMO, op, val);
                                break;
                        case "unlimited_superweapons":
                                got += GiveBit(e, items, IT_UNLIMITED_SUPERWEAPONS, op, val);
@@ -1847,7 +1846,7 @@ float GiveItems(entity e, float beginarg, float endarg)
 
        POSTGIVE_BIT(e, items, ITEM_JetpackRegen.m_itemid, SND_ITEMPICKUP, SND_Null);
        POSTGIVE_BIT(e, items, IT_UNLIMITED_SUPERWEAPONS, SND_POWERUP, SND_POWEROFF);
-       POSTGIVE_BIT(e, items, IT_UNLIMITED_WEAPON_AMMO, SND_POWERUP, SND_POWEROFF);
+       POSTGIVE_BIT(e, items, IT_UNLIMITED_AMMO, SND_POWERUP, SND_POWEROFF);
        POSTGIVE_BIT(e, items, ITEM_Jetpack.m_itemid, SND_ITEMPICKUP, SND_Null);
        FOREACH(Weapons, it != WEP_Null, {
                POSTGIVE_WEAPON(e, it, SND_WEAPONPICKUP, SND_Null);
index 6efb21495bbaed25831066aba3eddc9c91c24c18..5948d6a12e2831e0fcaf2f340cd7ae781ee72ce7 100644 (file)
@@ -232,7 +232,7 @@ void W_Arc_Beam_Think(entity this)
                }
 
                if(this == own.(weaponentity).arc_beam) { own.(weaponentity).arc_beam = NULL; }
-               if(!thiswep.wr_checkammo1(thiswep, own, weaponentity) && !(own.items & IT_UNLIMITED_WEAPON_AMMO))
+               if(!thiswep.wr_checkammo1(thiswep, own, weaponentity) && !(own.items & IT_UNLIMITED_AMMO))
                {
                        // note: this doesn't force the switch
                        W_SwitchToOtherWeapon(own, weaponentity);
@@ -244,7 +244,7 @@ void W_Arc_Beam_Think(entity this)
 
        // decrease ammo
        float coefficient = frametime;
-       if(!(own.items & IT_UNLIMITED_WEAPON_AMMO))
+       if(!(own.items & IT_UNLIMITED_AMMO))
        {
                float rootammo;
                if(burst)
index 3589146352e18d6fe74b3616147cc6233b3d7958..2a42f475b4cd1e094f15c931af5e21ff941fabe9 100644 (file)
@@ -568,7 +568,7 @@ METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentit
             }
             actor.(weaponentity).crylink_waitrelease = 0;
             if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity) && !thiswep.wr_checkammo2(thiswep, actor, weaponentity))
-            if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+            if(!(actor.items & IT_UNLIMITED_AMMO))
             {
                 // ran out of ammo!
                 actor.cnt = thiswep.m_id;
index 5654488ddb065d4e9aeb49b8f95cda1889de2132..62b7b556f29b7d35acb1c9b4a8f184af775ba992 100644 (file)
@@ -47,7 +47,7 @@ void W_Devastator_Explode(entity this, entity directhitentity)
        if(this.realowner.(weaponentity).m_weapon == thiswep)
        {
                if(GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(devastator, ammo))
-               if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
+               if(!(this.realowner.items & IT_UNLIMITED_AMMO))
                {
                        this.realowner.cnt = thiswep.m_id;
                        ATTACK_FINISHED(this.realowner, weaponentity) = time;
@@ -140,7 +140,7 @@ void W_Devastator_DoRemoteExplode(entity this, .entity weaponentity)
        if(this.realowner.(weaponentity).m_weapon == thiswep)
        {
                if(GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(devastator, ammo))
-               if(!(this.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
+               if(!(this.realowner.items & IT_UNLIMITED_AMMO))
                {
                        this.realowner.cnt = thiswep.m_id;
                        ATTACK_FINISHED(this.realowner, weaponentity) = time;
index 51699bf0cdc560a981cf7cb5d9abdcec4998585c..0ffa0c74d973b92f00f9c5fb4b06b22a522f0704 100644 (file)
@@ -264,7 +264,7 @@ void W_Hagar_Attack2_Load(Weapon thiswep, entity actor, .entity weaponentity)
 
        // this is different than WR_CHECKAMMO when it comes to reloading
        bool enough_ammo;
-       if(actor.items & IT_UNLIMITED_WEAPON_AMMO)
+       if(actor.items & IT_UNLIMITED_AMMO)
                enough_ammo = true;
        else if(autocvar_g_balance_hagar_reload_ammo)
                enough_ammo = actor.(weaponentity).(weapon_load[thiswep.m_id]) >= WEP_CVAR_SEC(hagar, ammo);
@@ -352,7 +352,7 @@ void W_Hagar_Attack2_Load(Weapon thiswep, entity actor, .entity weaponentity)
 
                // we aren't checking ammo during an attack, so we must do it here
                if(!(thiswep.wr_checkammo1(thiswep, actor, weaponentity) + thiswep.wr_checkammo2(thiswep, actor, weaponentity)))
-               if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+               if(!(actor.items & IT_UNLIMITED_AMMO))
                {
                        // note: this doesn't force the switch
                        W_SwitchToOtherWeapon(actor, weaponentity);
@@ -370,7 +370,7 @@ void W_Hagar_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int
        }
 
        if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity))
-       if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+       if(!(actor.items & IT_UNLIMITED_AMMO))
        {
                W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
                w_ready(thiswep, actor, weaponentity, fire);
index 8498597634bbcf7c689e1b5adcf2d480b75c0ff1..6511d22b572b4fab5938c035aea73d2e18dec6a2 100644 (file)
@@ -127,7 +127,7 @@ void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, .entity weaponentity, int
        if(PHYS_INPUT_BUTTON_ATCK(actor))
        {
                if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity))
-               if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+               if(!(actor.items & IT_UNLIMITED_AMMO))
                {
                        W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
                        w_ready(thiswep, actor, weaponentity, fire);
index d8cebd740ac49fc3daf8ec2c5d5111e30f27a740..d9e11dc012fb9d2736a0f04a56853d4ab9c9e14d 100644 (file)
@@ -145,7 +145,7 @@ METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity,
         actor.(weaponentity).hook_refire = max(actor.(weaponentity).hook_refire, time + WEP_CVAR_PRI(hook, refire) * W_WeaponRateFactor(actor));
 
         // hook also inhibits health regeneration, but only for 1 second
-        if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+        if(!(actor.items & IT_UNLIMITED_AMMO))
             actor.pauseregen_finished = max(actor.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen);
     }
 
@@ -163,7 +163,7 @@ METHOD(Hook, wr_think, void(entity thiswep, entity actor, .entity weaponentity,
         {
             if( time > actor.(weaponentity).hook_time_fueldecrease )
             {
-                if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+                if(!(actor.items & IT_UNLIMITED_AMMO))
                 {
                     if( GetResource(actor, RES_FUEL) >= (time - actor.(weaponentity).hook_time_fueldecrease) * hooked_fuel )
                     {
index aaf4900fe2e683029c66ccd93c2ae932c2bae3ec..8aed354348dcc6cd7f02f493faab75052a9cad13 100644 (file)
@@ -84,7 +84,7 @@ void W_MachineGun_Attack_Frame(Weapon thiswep, entity actor, .entity weaponentit
        if(PHYS_INPUT_BUTTON_ATCK(actor))
        {
                if(!thiswep.wr_checkammo2(thiswep, actor, weaponentity))
-               if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+               if(!(actor.items & IT_UNLIMITED_AMMO))
                {
                        W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
                        w_ready(thiswep, actor, weaponentity, fire);
@@ -110,7 +110,7 @@ void W_MachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity
        }
 
        if(!thiswep.wr_checkammo1(thiswep, actor, weaponentity))
-       if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+       if(!(actor.items & IT_UNLIMITED_AMMO))
        {
                W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
                w_ready(thiswep, actor, weaponentity, fire);
@@ -206,7 +206,7 @@ METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponen
         if(weapon_prepareattack(thiswep, actor, weaponentity, true, 0))
         {
             if(!thiswep.wr_checkammo2(thiswep, actor, weaponentity))
-            if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+            if(!(actor.items & IT_UNLIMITED_AMMO))
             {
                 W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
                 w_ready(thiswep, actor, weaponentity, fire);
index 648535eac08e29d216ab8d242a75faf3cd51edce..d7ba289f5ca7ee9f1e92669a9fd5098b93791771 100644 (file)
@@ -342,13 +342,11 @@ void W_Seeker_Attack(Weapon thiswep, entity actor, .entity weaponentity)
 
 void W_Seeker_Vollycontroller_Think(entity this) // TODO: Merge this with W_Seeker_Attack
 {
-       float c;
-       entity oldenemy;
        this.cnt = this.cnt - 1;
 
        Weapon thiswep = WEP_SEEKER;
        .entity weaponentity = this.weaponentity_fld;
-       if((!(this.realowner.items & IT_UNLIMITED_BOTH) && GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(seeker, missile_ammo)) || (this.cnt <= -1) || (IS_DEAD(this.realowner)) || (this.realowner.(weaponentity).m_switchweapon != thiswep))
+       if((!(this.realowner.items & IT_UNLIMITED_AMMO) && GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(seeker, missile_ammo)) || (this.cnt <= -1) || (IS_DEAD(this.realowner)) || (this.realowner.(weaponentity).m_switchweapon != thiswep))
        {
                delete(this);
                return;
@@ -358,11 +356,10 @@ void W_Seeker_Vollycontroller_Think(entity this) // TODO: Merge this with W_Seek
 
        entity own = this.realowner;
 
-       oldenemy = own.enemy;
+       entity oldenemy = own.enemy;
        own.enemy = this.enemy;
 
-       c = own.cnt % 4;
-       switch(c)
+       switch(own.cnt % 4)
        {
                case 0:
                        W_Seeker_Fire_Missile(thiswep, own, weaponentity, '-1.25 -3.75 0', own.enemy); // TODO
index 22c9288415f7636b6df39cd67277afc5c4d91022..1eee25a05cc1d0992a587d6304856f327f7f6f26 100644 (file)
@@ -153,7 +153,7 @@ void W_Shotgun_Attack2(Weapon thiswep, entity actor, .entity weaponentity, int f
 void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor, .entity weaponentity, int fire)
 {
        if (!thiswep.wr_checkammo2(thiswep, actor, weaponentity))
-       if (!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+       if (!(actor.items & IT_UNLIMITED_AMMO))
        {
                W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
                w_ready(thiswep, actor, weaponentity, fire);
@@ -174,7 +174,7 @@ void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor, .entity weaponentity
 void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, .entity weaponentity, int fire)
 {
        if (!thiswep.wr_checkammo2(thiswep, actor, weaponentity))
-       if (!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+       if (!(actor.items & IT_UNLIMITED_AMMO))
        {
                W_SwitchWeapon_Force(actor, w_getbestweapon(actor, weaponentity), weaponentity);
                w_ready(thiswep, actor, weaponentity, fire);
@@ -254,7 +254,7 @@ METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentit
     }
     if(actor.(weaponentity).clip_load >= 0) // we are not currently reloading
     if(WEP_CVAR(shotgun, secondary) == 1)
-    if(((fire & 1) && GetResource(actor, thiswep.ammo_type) <= 0 && !(actor.items & IT_UNLIMITED_WEAPON_AMMO)) || (fire & 2))
+    if(((fire & 1) && GetResource(actor, thiswep.ammo_type) <= 0 && !(actor.items & IT_UNLIMITED_AMMO)) || (fire & 2))
     if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(shotgun, refire)))
     {
         // attempt forcing playback of the anim by switching to another anim (that we never play) here...
index af7fac624195caa439ff0b54266f12ac80186353..46fd4d8c0887639b8b8c32e8b116c0f60ff4538e 100644 (file)
@@ -230,7 +230,7 @@ METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity
                         if(fire & 2) // only eat ammo when the button is pressed
                         {
                             dt = min(dt, (1 - actor.(weaponentity).vortex_charge) / WEP_CVAR(vortex, charge_rate));
-                            if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+                            if(!(actor.items & IT_UNLIMITED_AMMO))
                             {
                                 // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
                                 if(autocvar_g_balance_vortex_reload_ammo)
index c666fa94e3f308ff4694ba5e08a938e202b661b5..d53922f589a7277e8d30fefe578c9a19097e4016 100644 (file)
@@ -1340,7 +1340,7 @@ void navigation_routerating(entity this, entity e, float f, float rangebias)
                        LOG_DEBUG("jetpack ai: required fuel ", ftos(fuel), ", have ", ftos(GetResource(this, RES_FUEL)));
 
                        // enough fuel ?
-                       if(GetResource(this, RES_FUEL) > fuel || (this.items & IT_UNLIMITED_WEAPON_AMMO))
+                       if(GetResource(this, RES_FUEL) > fuel || (this.items & IT_UNLIMITED_AMMO))
                        {
                                // Estimate cost
                                // (as onground costs calculation is mostly based on distances, here we do the same establishing some relationship
index 0034c2dd9ee3b687a0b600eee0b850cc056dfb89..98616a76341f76ac901e838fdd7b81cb39478911 100644 (file)
@@ -1617,7 +1617,7 @@ void player_regen(entity this)
                        this.event_damage(this, this, this, 1, DEATH_ROT.m_id, DMG_NOWEP, this.origin, '0 0 0');
        }
 
-       if (!(this.items & IT_UNLIMITED_WEAPON_AMMO))
+       if (!(this.items & IT_UNLIMITED_AMMO))
        {
                float minf, maxf, limitf;
 
index c82f076d39531003262d0671667806ccc29ef88c..5fb0c7b94fef530a28b5e57288569185edbb7f5a 100644 (file)
@@ -715,7 +715,7 @@ void readplayerstartcvars()
        {
                g_weapon_stay = 0; // incompatible
                start_weapons = g_weaponarena_weapons;
-               start_items |= IT_UNLIMITED_BOTH;
+               start_items |= IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS;
        }
        else
        {
@@ -735,9 +735,9 @@ void readplayerstartcvars()
                start_items |= IT_UNLIMITED_SUPERWEAPONS;
 
        if(!cvar("g_use_ammunition"))
-               start_items |= IT_UNLIMITED_WEAPON_AMMO;
+               start_items |= IT_UNLIMITED_AMMO;
 
-       if(start_items & IT_UNLIMITED_WEAPON_AMMO)
+       if(start_items & IT_UNLIMITED_AMMO)
        {
                start_ammo_shells = 999;
                start_ammo_nails = 999;
index d4562dfc22af1ca9397d71b31dd2fb86d536208f..2f7dc88ba1436fffc693778aba98ddcdfad4100e 100644 (file)
@@ -23,7 +23,7 @@ TEST(Weapons, Hurt)
 
     it = a;
     PHYS_INPUT_BUTTON_ATCK(it) = true;
-    it.items |= IT_UNLIMITED_BOTH;
+    it.items |= IT_UNLIMITED_AMMO;
     Weapon wep = WEP_VORTEX;
     W_GiveWeapon(it, wep.m_id);
     W_SwitchWeapon_Force(it, wep, weaponentities[0]);
index 7f9c6ad0d76c379481cb3613fe3b322b0d7ecdff..f1866eab089311a0ce2c2a052d6b9b3fbaf00031 100644 (file)
@@ -70,7 +70,7 @@ bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andam
        {
                if (andammo)
                {
-                       if(this.items & IT_UNLIMITED_WEAPON_AMMO)
+                       if(this.items & IT_UNLIMITED_AMMO)
                        {
                                f = 1;
                        }
index 19ba40aa0b6ce6bc6913f0abb2a7ee99a80f5cb0..f2eec236c9a51b137a418cba35331c4ce1fd3d3b 100644 (file)
@@ -224,7 +224,7 @@ void w_ready(Weapon thiswep, entity actor, .entity weaponentity, int fire)
 .float prevwarntime;
 bool weapon_prepareattack_checkammo(Weapon thiswep, entity actor, bool secondary, .entity weaponentity)
 {
-       if ((actor.items & IT_UNLIMITED_WEAPON_AMMO)) return true;
+       if ((actor.items & IT_UNLIMITED_AMMO)) return true;
        bool ammo = false;
        if (secondary) ammo = thiswep.wr_checkammo2(thiswep, actor, weaponentity);
        else ammo = thiswep.wr_checkammo1(thiswep, actor, weaponentity);
@@ -688,7 +688,7 @@ void W_AttachToShotorg(entity actor, .entity weaponentity, entity flash, vector
 void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use, .entity weaponentity)
 {
        if (MUTATOR_CALLHOOK(W_DecreaseAmmo, actor, actor.(weaponentity), ammo_use)) return;
-       if ((actor.items & IT_UNLIMITED_WEAPON_AMMO) && !wep.reloading_ammo) return;
+       if ((actor.items & IT_UNLIMITED_AMMO) && !wep.reloading_ammo) return;
 
        ammo_use = M_ARGV(2, float);
 
@@ -735,7 +735,7 @@ void W_ReloadedAndReady(Weapon thiswep, entity actor, .entity weaponentity, int
        w_ent.clip_load = w_ent.old_clip_load;  // restore the ammo counter, in case we still had ammo in the weapon before reloading
 
        // if the gun uses no ammo, max out weapon load, else decrease ammo as we increase weapon load
-       if (!w_ent.reload_ammo_min || (actor.items & IT_UNLIMITED_WEAPON_AMMO) || wpn.ammo_type == RES_NONE)
+       if (!w_ent.reload_ammo_min || (actor.items & IT_UNLIMITED_AMMO) || wpn.ammo_type == RES_NONE)
        {
                w_ent.clip_load = w_ent.reload_ammo_amount;
        }
@@ -791,7 +791,7 @@ void W_Reload(entity actor, .entity weaponentity, float sent_ammo_min, Sound sen
        {
                if (!GetResource(actor, e.ammo_type) && this.reload_ammo_min)
                {
-                       if (!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
+                       if (!(actor.items & IT_UNLIMITED_AMMO))
                        {
                                if (IS_REAL_CLIENT(actor) && actor.reload_complain < time)
                                {