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,11 +242,12 @@ bool NewRpgMoveNpcAction::Execute(Event event)
} }
WorldObject* object = ObjectAccessor::GetWorldObject(*bot, info.near_npc.npcOrGo); 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) if (!info.near_npc.lastReach)
{ {
info.near_npc.lastReach = getMSTime(); info.near_npc.lastReach = getMSTime();
if (bot->CanInteractWithQuestGiver(object))
InteractWithNpcOrGameObjectForQuest(info.near_npc.npcOrGo); InteractWithNpcOrGameObjectForQuest(info.near_npc.npcOrGo);
return true; return true;
} }