X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fmutator_nix.qc;h=28bb8446902b29249d375d94e953886da444961c;hb=3e3baa2f19b654ab2982198e00ea8b09f885c66d;hp=8b8ea91f36c4e077109ff917ff4358e5aea1c5a9;hpb=e29603d545018c97349769107c7541212dc65cd3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mutators/mutator_nix.qc b/qcsrc/server/mutators/mutator_nix.qc index 8b8ea91f3..28bb84469 100644 --- a/qcsrc/server/mutators/mutator_nix.qc +++ b/qcsrc/server/mutators/mutator_nix.qc @@ -102,6 +102,22 @@ void NIX_GiveCurrentWeapon() self.nix_lastinfotime = -42; else 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) { @@ -212,6 +228,7 @@ MUTATOR_HOOKFUNCTION(nix_PlayerSpawn) { self.nix_lastchange_id = -1; NIX_GiveCurrentWeapon(); // overrides the weapons you got when spawning + self.items |= IT_UNLIMITED_SUPERWEAPONS; return 0; }