]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_nix.qc
Merge remote-tracking branch 'origin/divVerent/allow-override-item-model'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_nix.qc
index f429115ff0ca7fd2b343bc9c03fa0026fb8a9cff..519d51daa2510edd8f23ecef335e454127bd4f9c 100644 (file)
@@ -101,7 +101,23 @@ void NIX_GiveCurrentWeapon()
                if(dt >= 1 && dt <= 5)
                        self.nix_lastinfotime = -42;
                else
-                       Send_CSQC_Centerprint_Generic(self, CPID_NIX_WPNCHANGE, strcat("^2Active weapon: ^3", W_Name(nix_weapon)), 2, 0);
+                       Send_CSQC_Centerprint_Generic(self, CPID_NIX_WPNCHANGE, strcat("^2Active weapon: ^3", W_Name(nix_weapon)), 0, 0);
+
+               weapon_action(nix_weapon, WR_RESETPLAYER);
+
+               // all weapons must be fully loaded when we spawn
+               entity e;
+               e = get_weaponinfo(nix_weapon);
+               if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
+                       self.(weapon_load[nix_weapon]) = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
+
+               // nex too
+               if(autocvar_g_balance_nex_charge)
+               {
+                       if(autocvar_g_balance_nex_secondary_chargepool)
+                               self.nex_chargepool_ammo = 1;
+                       self.nex_charge = autocvar_g_balance_nex_charge_start;
+               }
        }
        if(self.nix_lastinfotime != dt)
        {