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:
parent
4250768a23
commit
d17aac161f
3 changed files with 15 additions and 3 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue