Fixed local copies of items not respecting their Amount value

This commit is contained in:
Boondorl 2024-04-17 20:54:16 -04:00 committed by Rachael Alexanderson
parent c3b9dd7c8f
commit 10a8a615cb
No known key found for this signature in database
GPG key ID: 26A8ACCE97115EE0

View file

@ -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;
}
//===========================================================================
//