From d6d3dd038e1b983fda51d6e28ab7f967a56585df Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Mon, 3 Dec 2018 17:12:42 +0100 Subject: [PATCH] Fix RemoveInventory not calling DetachFromOwner when an item is the first in the owner's inventory. Fix CheckAddToSlots not working because it uses GetReplacement incorrectly. --- wadsrc/static/zscript/actor_inventory.txt | 2 +- wadsrc/static/zscript/inventory/weapons.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/zscript/actor_inventory.txt b/wadsrc/static/zscript/actor_inventory.txt index a2e5a7a1f..f034f8fa0 100644 --- a/wadsrc/static/zscript/actor_inventory.txt +++ b/wadsrc/static/zscript/actor_inventory.txt @@ -122,11 +122,11 @@ extend class Actor if (invp.Inv == item) { invp.Inv = item.Inv; - item.DetachFromOwner(); break; } } } + item.DetachFromOwner(); item.Owner = NULL; item.Inv = NULL; } diff --git a/wadsrc/static/zscript/inventory/weapons.txt b/wadsrc/static/zscript/inventory/weapons.txt index cd96253ef..dc4c412a5 100644 --- a/wadsrc/static/zscript/inventory/weapons.txt +++ b/wadsrc/static/zscript/inventory/weapons.txt @@ -119,7 +119,7 @@ class Weapon : StateProvider virtual int, int CheckAddToSlots() { - if (GetReplacement(GetClass()) == null && !bPowered_Up) + if (GetReplacement(GetClass()) == GetClass() && !bPowered_Up) { return SlotNumber, SlotPriority*65536; }