mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
Fixed ammo limit for give cheat
https://forum.zdoom.org/viewtopic.php?t=58930
This commit is contained in:
parent
40fd816d54
commit
de4fc97ac6
1 changed files with 9 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue