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 fde6c863d1
commit e6df94ca76

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