]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/state.qc
Reuse the inventory clear function for map resets
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / state.qc
index 406003efcb0ab36e3bf7a48ded846b6ac63d4287..3060a51aa5f40e29c5af984bad43d96b92bf702b 100644 (file)
@@ -4,9 +4,9 @@
 
 void Inventory_new(PlayerState this);
 void Inventory_delete(entity this);
+void Inventory_clear(PlayerState this);
 void InventoryStorage_attach(PlayerState this);
 void InventoryStorage_delete(PlayerState this);
-void InventoryStorage_clear(PlayerState this);
 
 void PlayerState_attach(entity this)
 {
@@ -23,7 +23,7 @@ void PlayerState_detach(entity this)
     PlayerState ps = PS(this);
        if (!ps) return;  // initial connect
        PS(this) = NULL;
-    InventoryStorage_clear(this);
+    Inventory_clear(this.inventory_store); // no need to network updates, as there is no inventory attached
 
        if (ps.m_client != this) return;  // don't own state, spectator
        ps.ps_push(ps, this);