]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/state.qc
Fix weapon specific checks for melee
[xonotic/xonotic-data.pk3dir.git] / 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);