From: Rudolf Polzer Date: Mon, 22 Aug 2011 19:17:29 +0000 (+0200) Subject: NIX: reset weapon load on forced weapon switch X-Git-Tag: xonotic-v0.5.0~86 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=7e5d7a8b27472cfe2c325373dc7639a662cafd2f NIX: reset weapon load on forced weapon switch --- diff --git a/qcsrc/server/mutators/mutator_nix.qc b/qcsrc/server/mutators/mutator_nix.qc index 8b8ea91f3..5a35b137b 100644 --- a/qcsrc/server/mutators/mutator_nix.qc +++ b/qcsrc/server/mutators/mutator_nix.qc @@ -102,6 +102,13 @@ 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")); } if(self.nix_lastinfotime != dt) {