diff --git a/Projects/UOContent/Gumps/Base/StaticGump.cs b/Projects/UOContent/Gumps/Base/StaticGump.cs index c0f5eb920..8b428ab0b 100644 --- a/Projects/UOContent/Gumps/Base/StaticGump.cs +++ b/Projects/UOContent/Gumps/Base/StaticGump.cs @@ -33,6 +33,9 @@ public abstract class StaticGump : BaseGump where TSelf : StaticGump true; + public override int Switches => _switches; public override int TextEntries => _textEntries; @@ -67,7 +70,7 @@ public abstract class StaticGump : BaseGump where TSelf : StaticGump : BaseGump where TSelf : StaticGump.Shared.Rent(_staticStrings.Length + stringsData.Length); + var stringsLength = _staticStrings.Length + stringsData.Length; + + var buffer = STArrayPool.Shared.Rent(stringsLength); _staticStrings.CopyTo(buffer.AsSpan()); stringsData.CopyTo(buffer.AsSpan(_staticStrings.Length)); - OutgoingGumpPackets.WritePacked(buffer, ref writer); + OutgoingGumpPackets.WritePacked(buffer.AsSpan(0, stringsLength), ref writer); STArrayPool.Shared.Return(buffer); } }