fix(Core/Movement): Only update home position for patrolling NPCs (#24080)

Co-authored-by: blinkysc <[email protected]>
Co-authored-by: sudlud <[email protected]>
This commit is contained in:
blinkysc
2026-03-20 22:44:38 -03:00
committed by GitHub
co-authored by blinkysc sudlud
parent 4250768a23
commit d17aac161f
3 changed files with 15 additions and 3 deletions
+5 -1
View File
@@ -874,7 +874,11 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid, uint32 vendorEntry)
// Stop the npc if moving
if (uint32 pause = vendor->GetMovementTemplate().GetInteractionPauseTimer())
vendor->PauseMovement(pause);
vendor->SetHomePosition(vendor->GetPosition());
// Update home position for patrolling NPCs only (prevents drift for stationary NPCs)
if (vendor->GetDefaultMovementType() == WAYPOINT_MOTION_TYPE ||
vendor->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
vendor->SetHomePosition(vendor->GetPosition());
SetCurrentVendor(vendorEntry);
+5 -1
View File
@@ -162,7 +162,11 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
// Stop the npc if moving
if (uint32 pause = unit->GetMovementTemplate().GetInteractionPauseTimer())
unit->PauseMovement(pause);
unit->SetHomePosition(unit->GetPosition());
// Update home position for patrolling NPCs only (prevents drift for stationary NPCs)
if (unit->GetDefaultMovementType() == WAYPOINT_MOTION_TYPE ||
unit->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
unit->SetHomePosition(unit->GetPosition());
// If spiritguide, no need for gossip menu, just put player into resurrect queue
if (unit->IsSpiritGuide())
+5 -1
View File
@@ -96,7 +96,11 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket& recvData)
// Stop the npc if moving
if (uint32 pause = creature->GetMovementTemplate().GetInteractionPauseTimer())
creature->PauseMovement(pause);
creature->SetHomePosition(creature->GetPosition());
// Update home position for patrolling NPCs only (prevents drift for stationary NPCs)
if (creature->GetDefaultMovementType() == WAYPOINT_MOTION_TYPE ||
creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
creature->SetHomePosition(creature->GetPosition());
if (sScriptMgr->OnGossipHello(_player, creature))
return;