diff --git a/wadsrc/static/zscript/actors/inventory/inventory.zs b/wadsrc/static/zscript/actors/inventory/inventory.zs index c9890c699fc..a2af1039879 100644 --- a/wadsrc/static/zscript/actors/inventory/inventory.zs +++ b/wadsrc/static/zscript/actors/inventory/inventory.zs @@ -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; + } //=========================================================================== //