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)