From 0b2a919bbe2ca675d0fed29a9b3362ccfa75e834 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 31 Dec 2018 19:03:02 +0100 Subject: [PATCH] - fixed crash in AutoUseStrifeHealth The loop never checked if the item was still valid and would continue to try to use it, even after it was removed from the inventory and destroyed. As native code this just failed silently, but with the VM it needs to be explicitly checked. --- wadsrc/static/zscript/shared/player_inventory.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wadsrc/static/zscript/shared/player_inventory.txt b/wadsrc/static/zscript/shared/player_inventory.txt index 228e2bbf8..c71c1f3d8 100644 --- a/wadsrc/static/zscript/shared/player_inventory.txt +++ b/wadsrc/static/zscript/shared/player_inventory.txt @@ -309,7 +309,8 @@ extend class PlayerPawn while (player.health < 50) { - if (!UseInventory (Items[index])) + let item = Items[index]; + if (item == null || !UseInventory (item)) break; } if (player.health >= 50) return;