Fix move npc action (#1087)

This commit is contained in:
Yunfan Li
2025-03-17 23:52:41 +08:00
committed by GitHub
parent c4a4d3a9e6
commit 015d6605a6

View File

@@ -242,12 +242,13 @@ bool NewRpgMoveNpcAction::Execute(Event event)
}
WorldObject* object = ObjectAccessor::GetWorldObject(*bot, info.near_npc.npcOrGo);
if (object && bot->CanInteractWithQuestGiver(object))
if (object && bot->GetDistance(object) <= INTERACTION_DISTANCE)
{
if (!info.near_npc.lastReach)
{
info.near_npc.lastReach = getMSTime();
InteractWithNpcOrGameObjectForQuest(info.near_npc.npcOrGo);
if (bot->CanInteractWithQuestGiver(object))
InteractWithNpcOrGameObjectForQuest(info.near_npc.npcOrGo);
return true;
}