From d898cadda56eca396f0e8a8e5ed3a3c06f6c9510 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 4 Jan 2019 18:56:14 +0100 Subject: [PATCH] - fixed: Trying to remove the first item in an actor's inventory would lose all owned items. --- wadsrc/static/zscript/actor_inventory.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wadsrc/static/zscript/actor_inventory.txt b/wadsrc/static/zscript/actor_inventory.txt index c39070c4e..485194d9a 100644 --- a/wadsrc/static/zscript/actor_inventory.txt +++ b/wadsrc/static/zscript/actor_inventory.txt @@ -110,14 +110,12 @@ extend class Actor virtual void RemoveInventory(Inventory item) { - Inventory invp; - if (item != NULL && item.Owner != NULL) // can happen if the owner was destroyed by some action from an item's use state. { if (Inv == item) Inv = item.Inv; else { - for (invp = Inv; invp != null; invp = invp.Inv) + for (Actor invp = self; invp != null; invp = invp.Inv) { if (invp.Inv == item) {