]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Reset active weapon field of the current PlayerState and update the relative STAT... 337/head
authorterencehill <piuntn@gmail.com>
Wed, 13 Jul 2016 18:17:01 +0000 (20:17 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 14 Jul 2016 09:24:42 +0000 (11:24 +0200)
qcsrc/common/state.qc

index 0ffe55eb4fa50ba77a3c0c22ddb5c2b4defa2812..7c6882088dba4a604998fe824b866a66a16f2d68 100644 (file)
@@ -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);