]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/state.qc
Move Inventory to PlayerState and disable the entity pickup messages
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / state.qc
index 772dbccbd58d870137b69ab4143fc053e3b02e81..2e3a262a59e9662c2456e77a7277f2cb9bd9acef 100644 (file)
@@ -7,7 +7,7 @@ void PlayerState_attach(entity this)
 {
        this._ps = NEW(PlayerState, this);
 
-       Inventory_new(this);
+       Inventory_new(PS(this));
 }
 
 void PlayerState_detach(entity this)
@@ -18,11 +18,10 @@ void PlayerState_detach(entity this)
 
        if (ps.m_client != this) return;  // don't own state, spectator
        ps.ps_push(ps, this);
+    Inventory_delete(ps);
 
        FOREACH_CLIENT(PS(it) == ps, { PS(it) = NULL; });
        delete(ps);
-
-    Inventory_delete(this);
 }
 
 void GetCvars(entity this, entity store, int);