diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index b7d8871951..ecd6b8d1c6 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -638,20 +638,23 @@ bool AActor::GiveInventory(PClassInventory *type, int amount, bool givecheat) // This shouldn't count for the item statistics! item->ClearCounters(); - if (type->IsDescendantOf (RUNTIME_CLASS(ABasicArmorPickup))) + if (!givecheat || amount > 0) { - static_cast(item)->SaveAmount *= amount; - } - else if (type->IsDescendantOf (RUNTIME_CLASS(ABasicArmorBonus))) - { - static_cast(item)->SaveAmount *= amount; - } - else - { - if (!givecheat) - item->Amount = amount; + if (type->IsDescendantOf (RUNTIME_CLASS(ABasicArmorPickup))) + { + static_cast(item)->SaveAmount *= amount; + } + else if (type->IsDescendantOf (RUNTIME_CLASS(ABasicArmorBonus))) + { + static_cast(item)->SaveAmount *= amount; + } else - item->Amount = MIN (amount, item->MaxAmount); + { + if (!givecheat) + item->Amount = amount; + else + item->Amount = MIN (amount, item->MaxAmount); + } } if (!item->CallTryPickup (this)) {