From: terencehill Date: Wed, 13 Jul 2016 18:17:01 +0000 (+0200) Subject: Reset active weapon field of the current PlayerState and update the relative STAT... X-Git-Tag: xonotic-v0.8.2~700^2~66^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=36cc46ec68f6925b85e9689dad6ec360bd691215;p=xonotic%2Fxonotic-data.pk3dir.git Reset active weapon field of the current PlayerState and update the relative STAT when player becomes observer --- diff --git a/qcsrc/common/state.qc b/qcsrc/common/state.qc index 0ffe55eb4..7c6882088 100644 --- a/qcsrc/common/state.qc +++ b/qcsrc/common/state.qc @@ -15,6 +15,12 @@ void PlayerState_detach(entity this) PlayerState ps = PS(this); if (!ps) return; // initial connect PS(this) = NULL; + + ps.m_switchweapon = WEP_Null; + ps.m_weapon = WEP_Null; + ps.m_switchingweapon = WEP_Null; + ps.ps_push(ps, this); + if (ps.m_client != this) return; // don't own state, spectator FOREACH_CLIENT(PS(it) == ps, { PS(it) = NULL; }); remove(ps);