mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 06:42:08 +00:00
Fixed local copies of items not respecting their Amount value
This commit is contained in:
parent
fde6c863d1
commit
e6df94ca76
1 changed files with 10 additions and 2 deletions
|
@ -414,7 +414,10 @@ class Inventory : Actor
|
|||
{
|
||||
Inventory copy;
|
||||
|
||||
Amount = MIN(Amount, MaxAmount);
|
||||
// Clamping this on local copy creation presents too many possible
|
||||
// pitfalls (e.g. Health items).
|
||||
if (!IsCreatingLocalCopy())
|
||||
Amount = MIN(Amount, MaxAmount);
|
||||
if (GoAway ())
|
||||
{
|
||||
copy = Inventory(Spawn (GetClass()));
|
||||
|
@ -1046,7 +1049,7 @@ class Inventory : Actor
|
|||
|
||||
protected bool GoAway ()
|
||||
{
|
||||
if (bCreatingCopy)
|
||||
if (IsCreatingLocalCopy())
|
||||
return true;
|
||||
|
||||
// Dropped items never stick around
|
||||
|
@ -1130,6 +1133,11 @@ class Inventory : Actor
|
|||
|
||||
return item;
|
||||
}
|
||||
|
||||
protected clearscope bool IsCreatingLocalCopy() const
|
||||
{
|
||||
return bCreatingCopy;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue