]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
allow NIX to live toggle blaster on/off
authordrjaska <drjaska83@gmail.com>
Thu, 29 Dec 2022 17:36:56 +0000 (19:36 +0200)
committerdrjaska <drjaska83@gmail.com>
Thu, 29 Dec 2022 17:36:56 +0000 (19:36 +0200)
qcsrc/common/mutators/mutator/nix/sv_nix.qc

index c53c76eb777e1773700264ca807ae9b6e4a55f3d..12d76963ffd295a60168dcc3b31f1942a79ba3aa 100644 (file)
@@ -28,7 +28,6 @@ int autocvar_g_pickup_nails_max;
 int autocvar_g_pickup_rockets_max;
 int autocvar_g_pickup_shells_max;
 
-float g_nix_with_blaster;
 // WEAPONTODO
 int nix_weapon;
 float nix_nextchange;
@@ -43,8 +42,6 @@ REGISTER_MUTATOR(nix, expr_evaluate(cvar_string("g_nix")) && !MUTATOR_IS_ENABLED
 {
        MUTATOR_ONADD
        {
-               g_nix_with_blaster = autocvar_g_nix_with_blaster;
-
                nix_nextchange = 0;
                nix_nextweapon = 0;
 
@@ -92,7 +89,7 @@ bool NIX_CanChooseWeapon(int wpn)
        }
        else
        {
-               if(wpn == WEP_BLASTER.m_id && g_nix_with_blaster)
+               if(wpn == WEP_BLASTER.m_id && autocvar_g_nix_with_blaster)
                        return false;
                if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
                        return false;
@@ -213,7 +210,7 @@ void NIX_GiveCurrentWeapon(entity this)
        }
 
        STAT(WEAPONS, this) = '0 0 0';
-       if(g_nix_with_blaster)
+       if(autocvar_g_nix_with_blaster)
                STAT(WEAPONS, this) |= WEPSET(BLASTER);
        STAT(WEAPONS, this) |= wpn.m_wepset;