From bf52ce19e4af1f49e6f6c41aa40a6971446f5589 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 15 Jan 2017 18:58:17 +0100 Subject: [PATCH] - fixed: AActor::ClearInventory should respect IF_KEEPDEPLETED for all items. --- src/namedef.h | 1 + src/p_mobj.cpp | 13 +------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/namedef.h b/src/namedef.h index dc52d27f13..329b2cea39 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -170,6 +170,7 @@ xx(PuzzleItem) xx(PuzzleItemNumber) xx(HealthPickup) xx(autousemode) +xx(Ammo) xx(AcolyteBlue) xx(SpectralLightningV1) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index fc382a9886..b40b8baa3d 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1199,18 +1199,7 @@ void AActor::ClearInventory() AInventory *inv = *invp; if (!(inv->ItemFlags & IF_UNDROPPABLE)) { - // For the sake of undroppable weapons, never remove ammo once - // it has been acquired; just set its amount to 0. - if (inv->IsKindOf(RUNTIME_CLASS(AAmmo))) - { - AAmmo *ammo = static_cast(inv); - ammo->Amount = 0; - invp = &inv->Inventory; - } - else - { - inv->Destroy (); - } + inv->DepleteOrDestroy(); } else if (inv->GetClass() == RUNTIME_CLASS(AHexenArmor)) {