fix(core): Fixes buy packet (#453)

- [X] Fixes buy packet
- [X] Changes from null to empty string in gump initial text
This commit is contained in:
Kamron Batman 2021-02-04 10:40:41 -08:00 • committed by GitHub
parent 995149ad01
commit 50e9b367fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 12 deletions

View file

@ -48,7 +48,7 @@ namespace Server.Gumps
public string InitialText { get; set; }
public override string Compile(OrderedHashSet<string> strings) =>
$"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {strings.GetOrAdd(InitialText)} }}";
$"{{ textentry {X} {Y} {Width} {Height} {Hue} {EntryID} {strings.GetOrAdd(InitialText ?? "")} }}";
public override void AppendTo(ref SpanWriter writer, OrderedHashSet<string> strings, ref int entries, ref int switches)
{
@ -67,7 +67,7 @@ namespace Server.Gumps
writer.WriteAscii(' ');
writer.WriteAscii(EntryID.ToString());
writer.WriteAscii(' ');
writer.WriteAscii(strings.GetOrAdd(InitialText).ToString());
writer.WriteAscii(strings.GetOrAdd(InitialText ?? "").ToString());
writer.Write((ushort)0x207D); // " }"
entries++;