mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
Generalized maximum amount for give cheat
https://forum.zdoom.org/viewtopic.php?t=58930
This commit is contained in:
parent
294bf6ed53
commit
8f70d70dd6
1 changed files with 5 additions and 3 deletions
|
@ -831,9 +831,11 @@ bool AActor::GiveInventory(PClassActor *type, int amount, bool givecheat)
|
|||
{
|
||||
if (givecheat)
|
||||
{
|
||||
item->Amount = MIN(amount, type->IsDescendantOf(NAME_Ammo)
|
||||
? item->IntVar("BackpackMaxAmount")
|
||||
: item->MaxAmount);
|
||||
const AInventory *const haveitem = FindInventory(type);
|
||||
|
||||
item->Amount = MIN(amount, nullptr == haveitem
|
||||
? static_cast<AInventory*>(GetDefaultByType(type))->MaxAmount
|
||||
: haveitem->MaxAmount);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue