mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-15 00:42:20 +00:00
Fixed local copies of items not respecting their Amount value
This commit is contained in:
parent
c3b9dd7c8f
commit
10a8a615cb
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