From 36cc46ec68f6925b85e9689dad6ec360bd691215 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 13 Jul 2016 20:17:01 +0200 Subject: [PATCH] Reset active weapon field of the current PlayerState and update the relative STAT when player becomes observer --- qcsrc/common/state.qc | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.39.2