From 18c068fd1f803e97d96224994145f950bd78b82e Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 30 Sep 2024 03:27:39 -0400 Subject: [PATCH] Revert "- fix some issues with ClearInventory() that sometimes caused script errors" This reverts commit 41c69736b1544158816c9254a5837afd79b06209. This introduced more bugs and so the fix was not valid. --- wadsrc/static/zscript/actors/inventory/inventory.zs | 1 - wadsrc/static/zscript/actors/inventory_util.zs | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/wadsrc/static/zscript/actors/inventory/inventory.zs b/wadsrc/static/zscript/actors/inventory/inventory.zs index f41880a3c..52009f2e1 100644 --- a/wadsrc/static/zscript/actors/inventory/inventory.zs +++ b/wadsrc/static/zscript/actors/inventory/inventory.zs @@ -940,7 +940,6 @@ class Inventory : Actor } else { - Owner = null; Destroy(); } } diff --git a/wadsrc/static/zscript/actors/inventory_util.zs b/wadsrc/static/zscript/actors/inventory_util.zs index e47172a49..011ca134f 100644 --- a/wadsrc/static/zscript/actors/inventory_util.zs +++ b/wadsrc/static/zscript/actors/inventory_util.zs @@ -333,13 +333,8 @@ extend class Actor // destroy something we already processed, we've already destroyed it, // so it won't have anything to destroy. - if (player != null) - { - player.ReadyWeapon = null; - player.PendingWeapon = WP_NOCHANGE; - } - let last = self; + while (last.inv != NULL) { let inv = last.inv; @@ -353,6 +348,11 @@ extend class Actor last = inv; } } + if (player != null) + { + player.ReadyWeapon = null; + player.PendingWeapon = WP_NOCHANGE; + } }