From 02435b46a0af7287a542a0887ec7ac7aa828f742 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Sun, 13 Nov 2016 19:27:59 -0600 Subject: [PATCH] Fixed: A_SetInventory with an amount of 0 was not truly eliminating the actor. --- src/p_actionfunctions.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 73cade49a..b9cfd7fe0 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -2665,8 +2665,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetInventory) } else if (amount <= 0) { - //Remove it all. - res = (mobj->TakeInventory(itemtype, item->Amount, true, false)); + // Remove it all. + if (item) + { + item->DepleteOrDestroy(); + res = true; + } ACTION_RETURN_BOOL(res); } else if (amount < item->Amount)