mirror of
https://github.com/mehah/otclient
synced 2026-08-15 16:29:06 -04:00
fix: NPC dialog window shows the wrong NPC when several are in talk range (#1795)
Bug Fixes: - NPC conversations now open with the currently active NPC instead of the oldest listed NPC.
This commit is contained in:
parent
46ec6f13de
commit
d978b8e14e
1 changed files with 4 additions and 1 deletions
|
|
@ -169,7 +169,10 @@ function onNpcChatWindow(data)
|
|||
if type(data) ~= "table" or type(data.npcIds) ~= "table" or #data.npcIds == 0 then
|
||||
return
|
||||
end
|
||||
local creature = g_map.getCreatureById(data.npcIds[1])
|
||||
-- The server appends every greeting NPC to the list and builds the buttons from the
|
||||
-- LAST id (the active conversation); npcIds[1] is the oldest, e.g. a bystander that
|
||||
-- happened to be in talk range. Showing npcIds[1] paints the wrong name and outfit.
|
||||
local creature = g_map.getCreatureById(data.npcIds[#data.npcIds])
|
||||
if creature then
|
||||
controllerNpcTrader:initNpcWindow(creature, data.buttons)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue