fix(Core/Movement): Only update home position for patrolling NPCs (#24080)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: sudlud <sudlud@users.noreply.github.com>
This commit is contained in:
@@ -874,7 +874,11 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid, uint32 vendorEntry)
|
|||||||
// Stop the npc if moving
|
// Stop the npc if moving
|
||||||
if (uint32 pause = vendor->GetMovementTemplate().GetInteractionPauseTimer())
|
if (uint32 pause = vendor->GetMovementTemplate().GetInteractionPauseTimer())
|
||||||
vendor->PauseMovement(pause);
|
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);
|
SetCurrentVendor(vendorEntry);
|
||||||
|
|
||||||
|
|||||||
@@ -162,7 +162,11 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
|
|||||||
// Stop the npc if moving
|
// Stop the npc if moving
|
||||||
if (uint32 pause = unit->GetMovementTemplate().GetInteractionPauseTimer())
|
if (uint32 pause = unit->GetMovementTemplate().GetInteractionPauseTimer())
|
||||||
unit->PauseMovement(pause);
|
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 spiritguide, no need for gossip menu, just put player into resurrect queue
|
||||||
if (unit->IsSpiritGuide())
|
if (unit->IsSpiritGuide())
|
||||||
|
|||||||
@@ -96,7 +96,11 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket& recvData)
|
|||||||
// Stop the npc if moving
|
// Stop the npc if moving
|
||||||
if (uint32 pause = creature->GetMovementTemplate().GetInteractionPauseTimer())
|
if (uint32 pause = creature->GetMovementTemplate().GetInteractionPauseTimer())
|
||||||
creature->PauseMovement(pause);
|
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))
|
if (sScriptMgr->OnGossipHello(_player, creature))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user