X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Finventory.qh;h=ba824f40b41c14c470a214c33eeb0bd6e9064c4d;hb=791f300d2660d6b75a51c6e7f302d6fa6b64861a;hp=9075c0912ed2a5044ba8e7b80b299a05723f31ba;hpb=0076d3f631e54b908b7506883c75c6d28f6b9505;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/inventory.qh b/qcsrc/common/items/inventory.qh index 9075c0912..ba824f40b 100644 --- a/qcsrc/common/items/inventory.qh +++ b/qcsrc/common/items/inventory.qh @@ -107,7 +107,7 @@ bool Inventory_Send(Inventory this, Client to, int sf) TC(Inventory, this); WriteHeader(MSG_ENTITY, ENT_CLIENT_INVENTORY); entity e = this.owner; - if (IS_SPEC(e)) e = e.enemy; + if (IS_SPEC(e)) e = PS(e.enemy); // TODO: how can this *ever* be the case? TC(Player, e); Inventory data = e.inventory; Inventory_Write(data); @@ -118,7 +118,7 @@ void Inventory_new(entity e) { Inventory inv = NEW(Inventory), bak = NEW(Inventory); inv.inventory = bak; - inv.drawonlytoclient = e; + inv.drawonlytoclient = IS_CLIENT(e) ? e : e.m_client; Net_LinkEntity((inv.owner = e).inventory = inv, false, 0, Inventory_Send); } void Inventory_delete(entity e) { delete(e.inventory.inventory); delete(e.inventory); }