Fixes GoGump NPE (#221)

This commit is contained in:
Kamron Batman 2020-09-03 22:16:04 -07:00 committed by GitHub
parent dcbbb13e72
commit 7238328361
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -163,7 +163,9 @@ namespace Server.Gumps
x = BorderSize + OffsetSize;
y += EntryHeight + OffsetSize;
var name = index >= node.Categories.Length ? node.Locations[index].Name : node.Categories[index].Name;
var name = index >= node.Categories.Length
? node.Locations[index - node.Categories.Length].Name
: node.Categories[index].Name;
AddImageTiled(x, y, EntryWidth, EntryHeight, EntryGumpID);
AddLabelCropped(x + TextOffsetX, y, EntryWidth - TextOffsetX, EntryHeight, TextHue, name);