- fixed: AActor::ClearInventory should respect IF_KEEPDEPLETED for all items.

This commit is contained in:
Christoph Oelckers 2017-01-15 18:58:17 +01:00
parent 03c7b10fd6
commit bf52ce19e4
2 changed files with 2 additions and 12 deletions

View File

@ -170,6 +170,7 @@ xx(PuzzleItem)
xx(PuzzleItemNumber)
xx(HealthPickup)
xx(autousemode)
xx(Ammo)
xx(AcolyteBlue)
xx(SpectralLightningV1)

View File

@ -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<AAmmo*>(inv);
ammo->Amount = 0;
invp = &inv->Inventory;
}
else
{
inv->Destroy ();
}
inv->DepleteOrDestroy();
}
else if (inv->GetClass() == RUNTIME_CLASS(AHexenArmor))
{