]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Only swap the Nexuiz weapons with items if they're mutator blocked, allows mutators...
authorMario <mario.mario@y7mail.com>
Wed, 3 Jun 2020 08:29:18 +0000 (18:29 +1000)
committerMario <mario.mario@y7mail.com>
Wed, 3 Jun 2020 08:29:18 +0000 (18:29 +1000)
qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/seeker.qc

index fdcce46086fb07e63ebf441662f83904e209acf0..47e1c97a9a9a70f1df5a7214ac56e12e8080bbed 100644 (file)
@@ -86,8 +86,6 @@ REGISTER_MUTATOR(nt, expr_evaluate(cvar_string("g_new_toys")) && !MUTATOR_IS_ENA
                        if(nt_IsNewToy(it.m_id))
                                it.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED;
                });
-
-               cvar_settemp("sv_nexuizcompat_weaponswap", "0"); // disable compatibility so these weapons aren't auto replaced elsewhere
        }
 
        MUTATOR_ONROLLBACK_OR_REMOVE
index dbc65b93efb0e5de068136f0e6e2442419878b69..9d58e513d6065db0571486c9053ad3c616a072dc 100644 (file)
@@ -4,7 +4,7 @@
 
 METHOD(HLAC, m_spawnfunc_hookreplace, Weapon(HLAC this, entity e))
 {
-    if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e))
+    if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e) && (this.spawnflags & WEP_FLAG_MUTATORBLOCKED))
     {
         return ITEM_ArmorBig;
     }
index 48b869f941d33de665ecdfc08766153c2f7adf88..f94d6c1482b8e73eeb1aa70f850c41e96ca66a3d 100644 (file)
@@ -4,7 +4,7 @@
 
 METHOD(MineLayer, m_spawnfunc_hookreplace, Weapon(MineLayer this, entity e))
 {
-    if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e))
+    if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e) && (this.spawnflags & WEP_FLAG_MUTATORBLOCKED))
     {
         return ITEM_HealthBig;
     }
index 9edf486a0b7fb4efba7e819d952109a3dfd49977..0b8637345860b5864d20c404a7db33fc7844f030 100644 (file)
@@ -4,7 +4,7 @@
 
 METHOD(Rifle, m_spawnfunc_hookreplace, Weapon(Rifle this, entity e))
 {
-    if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e))
+    if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e) && (this.spawnflags & WEP_FLAG_MUTATORBLOCKED))
     {
         return ITEM_ArmorBig;
     }
index 9a6abb11cc7832c0233e85160cbebb43a483fab6..d60bb194d2828f574e033800b9e0d20e7332d0c4 100644 (file)
@@ -4,7 +4,7 @@
 
 METHOD(Seeker, m_spawnfunc_hookreplace, Weapon(Seeker this, entity e))
 {
-    if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e))
+    if (autocvar_sv_nexuizcompat_weaponswap && !Item_IsLoot(e) && (this.spawnflags & WEP_FLAG_MUTATORBLOCKED))
     {
         return ITEM_HealthBig;
     }