]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/state.qh
Viewmodel: fix switching when spectating
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / state.qh
index fcc3656b8dcd710c76305925e1868e18bef0777b..f5f0c42404e7238ec21cb7706f54706d85e89552 100644 (file)
@@ -45,6 +45,7 @@ void PlayerState_attach(entity this)
 void PlayerState_detach(entity this)
 {
        if (!PS(this)) return;  // initial connect
+       FOREACH_CLIENT(PS(it) == PS(this), { PS(it) = NULL; });
        remove(PS(this));
        this._ps = NULL;