]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
rename misleading const, fix overkill
authorMartin Taibr <taibr.martin@gmail.com>
Sun, 18 Aug 2019 15:13:28 +0000 (17:13 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Sun, 18 Aug 2019 15:13:28 +0000 (17:13 +0200)
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/overkill/sv_overkill.qc
qcsrc/common/t_items.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/tests.qc
ruleset-overkill.cfg

index 0a8370899dea2bce50728c5f674b623240e446e9..8f769a4595fb650a535ab31e8af770d172e7e161 100644 (file)
@@ -333,7 +333,7 @@ MUTATOR_HOOKFUNCTION(ca, GiveFragsForKill, CBC_ORDER_FIRST)
 
 MUTATOR_HOOKFUNCTION(ca, SetStartItems)
 {
-       start_items       &= ~IT_UNLIMITED_AMMO;
+       start_items       &= ~IT_UNLIMITED_BOTH;
        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 2dfcf48112447ad1a5411a60b3c5f925e567b3b2..1158719fc2ac3027ec994d8e114d54bc9c7223a4 100644 (file)
@@ -549,7 +549,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
 
 MUTATOR_HOOKFUNCTION(ft, SetStartItems)
 {
-       start_items &= ~IT_UNLIMITED_AMMO;
+       start_items &= ~IT_UNLIMITED_BOTH;
        //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 6d420c7a95b82dd0701977e3608613360172408d..fa76eaf2f6e269e6d8b5fe05557f5231efd42081 100644 (file)
@@ -323,7 +323,7 @@ MUTATOR_HOOKFUNCTION(lms, GiveFragsForKill)
 
 MUTATOR_HOOKFUNCTION(lms, SetStartItems)
 {
-       start_items &= ~IT_UNLIMITED_AMMO;
+       start_items &= ~IT_UNLIMITED_BOTH;
        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 cf4e288ba6cd1769c127ef9ca27ab16ca8411579..1f01790d24b26ea6609705ea4c07031aad7207e5 100644 (file)
@@ -44,8 +44,8 @@ const int IT_SUPERWEAPON                              = BIT(21); // suit
 const int IT_STRENGTH                                  = BIT(22);
 
 // item masks
-const int IT_UNLIMITED_AMMO                    = IT_UNLIMITED_WEAPON_AMMO | IT_UNLIMITED_SUPERWEAPONS;
-const int IT_PICKUPMASK                        = IT_UNLIMITED_AMMO | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
+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
 
 #ifdef SVQC
 const .float strength_finished = _STAT(STRENGTH_FINISHED);
index 97df48106dcbc935fa4e38c0720f42b8cc3a0854..d25c3151f7edac55ee34808e30763b2f8fed6f27 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_AMMO) || (cvar("g_melee_only"))))
+       if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_WEAPON_AMMO) || (start_items & IT_UNLIMITED_BOTH) || (cvar("g_melee_only"))))
                return false;
        if (buff == BUFF_VAMPIRE && cvar("g_vampire"))
                return false;
index cb9aea5cc3b3d69206e3cec18587f83a40bdb09e..dbcda2d59e1db202a53f5d33cb5a4419609b2731 100644 (file)
@@ -274,6 +274,10 @@ MUTATOR_HOOKFUNCTION(ok, SetStartItems, CBC_ORDER_LAST)
        if(WEP_OVERKILL_RPC.weaponstart > 0) { ok_start_items |= WEPSET(OVERKILL_RPC); }
        if(WEP_OVERKILL_HMG.weaponstart > 0) { ok_start_items |= WEPSET(OVERKILL_HMG); }
 
+       // 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_weapons = warmup_start_weapons = ok_start_items;
 }
 
index 4a3712a25b31a02aac9b1e8d429933fb0463ca33..cd3162e5c9809be6517cbc179b1c7b2a0d00d113 100644 (file)
@@ -1497,7 +1497,7 @@ spawnfunc(target_items)
        {
                for(int j = 0; j < n; ++j)
                {
-                       if     (argv(j) == "unlimited_ammo")         this.items |= IT_UNLIMITED_AMMO;
+                       if     (argv(j) == "unlimited_ammo")         this.items |= IT_UNLIMITED_BOTH;
                        else if(argv(j) == "unlimited_weapon_ammo")  this.items |= IT_UNLIMITED_WEAPON_AMMO;
                        else if(argv(j) == "unlimited_superweapons") this.items |= IT_UNLIMITED_SUPERWEAPONS;
                        else if(argv(j) == "strength")               this.items |= ITEM_Strength.m_itemid;
@@ -1763,7 +1763,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_AMMO, op, val);
+                               got += GiveBit(e, items, IT_UNLIMITED_BOTH, op, val);
                        case "all":
                                got += GiveBit(e, items, ITEM_Jetpack.m_itemid, op, val);
                                got += GiveResourceValue(e, RES_HEALTH, op, val);
@@ -1781,7 +1781,7 @@ 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_AMMO, op, val);
+                               got += GiveBit(e, items, IT_UNLIMITED_BOTH, op, val);
                                break;
                        case "unlimited_weapon_ammo":
                                got += GiveBit(e, items, IT_UNLIMITED_WEAPON_AMMO, op, val);
index f8c2be1d50777e1cea209366fe830aee87381009..648535eac08e29d216ab8d242a75faf3cd51edce 100644 (file)
@@ -348,7 +348,7 @@ void W_Seeker_Vollycontroller_Think(entity this) // TODO: Merge this with W_Seek
 
        Weapon thiswep = WEP_SEEKER;
        .entity weaponentity = this.weaponentity_fld;
-       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))
+       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))
        {
                delete(this);
                return;
index 522840e763679681c641ccd3f271122db8012ea3..f305e4bb6dfee8e5c6d9abe80a8235ba33f0f8ea 100644 (file)
@@ -614,7 +614,7 @@ void readplayerstartcvars()
        {
                g_weapon_stay = 0; // incompatible
                start_weapons = g_weaponarena_weapons;
-               start_items |= IT_UNLIMITED_AMMO;
+               start_items |= IT_UNLIMITED_BOTH;
        }
        else
        {
@@ -634,7 +634,7 @@ void readplayerstartcvars()
                start_items |= IT_UNLIMITED_SUPERWEAPONS;
 
        if(!cvar("g_use_ammunition"))
-               start_items |= IT_UNLIMITED_AMMO;
+               start_items |= IT_UNLIMITED_BOTH;
 
        if(start_items & IT_UNLIMITED_WEAPON_AMMO)
        {
index 2f7dc88ba1436fffc693778aba98ddcdfad4100e..d4562dfc22af1ca9397d71b31dd2fb86d536208f 100644 (file)
@@ -23,7 +23,7 @@ TEST(Weapons, Hurt)
 
     it = a;
     PHYS_INPUT_BUTTON_ATCK(it) = true;
-    it.items |= IT_UNLIMITED_AMMO;
+    it.items |= IT_UNLIMITED_BOTH;
     Weapon wep = WEP_VORTEX;
     W_GiveWeapon(it, wep.m_id);
     W_SwitchWeapon_Force(it, wep, weaponentities[0]);
index 28b3d90a5298cd967a2b766358ee2d0f41e9d763..5b71bb60a0576d40959a59b0a91d7e3404dc61f4 100644 (file)
@@ -10,8 +10,6 @@ if_dedicated exec help-overkill.cfg
 
 g_overkill 1
 
-g_use_ammunition 0
-
 // hack - eventually, we should be able to choose overkill models in menu like for vanilla
 sv_defaultcharacter 1
 sv_defaultplayermodel "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm"