Skip to content

Commit

Permalink
[HS-1476] Merchants: display name does not always function correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
baughj committed Sep 22, 2024
1 parent 29a7d46 commit 60eb0eb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hybrasyl/Interfaces/IPursuitable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public sealed void DisplayPursuits(User invoker)
Tile2 = (ushort)(0x4000 + Sprite),
Color2 = 0,
PortraitType = 1,
Name = Name,
Name = string.IsNullOrWhiteSpace(DisplayName) ? Name : DisplayName,
Text = merchant.GetLocalString("greeting"),
Options = options
};
Expand Down
2 changes: 1 addition & 1 deletion hybrasyl/Objects/MapObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public void LoadXml(Map newMap)
Y = npcElement.Y,
Name = npcElement.Name,
Direction = npcElement.Direction,
DisplayName = string.IsNullOrWhiteSpace(npcElement.DisplayName) ? npcTemplate.DisplayName : npcElement.DisplayName
DisplayName = string.IsNullOrWhiteSpace(npcElement.DisplayName) ? npcTemplate.Name : npcElement.DisplayName
};
InsertNpc(merchant);
// Keep the actual spawned object around in the index for later use
Expand Down
2 changes: 1 addition & 1 deletion hybrasyl/Objects/Merchant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void OnSpawn()
}

// Do we have a script? If so, get it and run OnSpawn.
if (World.ScriptProcessor.TryGetScript(Name, out var script))
if (World.ScriptProcessor.TryGetScript(Name, out Script script) || World.ScriptProcessor.TryGetScript(DisplayName, out script))
{
DialogSequences.Clear();
Script = script;
Expand Down

0 comments on commit 60eb0eb

Please sign in to comment.