From 8aa47e664e48d1595461019930133fe0d475e181 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 17 Jan 2019 15:06:10 +0200 Subject: [PATCH] - fixed disappearing inventory after morphing pickup When player is picked up item that does morph, the corresponding toucher actor is changed in process Previously, morhing item was removed from original actor leaving player's inventory in inconsistent state https://forum.zdoom.org/viewtopic.php?t=63124 --- wadsrc/static/zscript/inventory/inventory.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wadsrc/static/zscript/inventory/inventory.txt b/wadsrc/static/zscript/inventory/inventory.txt index 7a6d4fd6b..f89bb7493 100644 --- a/wadsrc/static/zscript/inventory/inventory.txt +++ b/wadsrc/static/zscript/inventory/inventory.txt @@ -509,6 +509,13 @@ class Inventory : Actor // The item is placed in the inventory just long enough to be used. toucher.AddInventory(self); bool usegood = Use(true); + + // Handle potential change of toucher/owner because of morph + if (usegood && self.owner) + { + toucher = self.owner; + } + toucher.RemoveInventory(self); if (usegood)