diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index dc0e76ad1..1cc9d96f6 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -829,10 +829,16 @@ bool AActor::GiveInventory(PClassActor *type, int amount, bool givecheat) } else { - if (!givecheat) - item->Amount = amount; + if (givecheat) + { + item->Amount = MIN(amount, type->IsDescendantOf(NAME_Ammo) + ? item->IntVar("BackpackMaxAmount") + : item->MaxAmount); + } else - item->Amount = MIN (amount, item->MaxAmount); + { + item->Amount = amount; + } } } if (!item->CallTryPickup (this))