mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Movement: 7fff83d675 followup
remove home position set from creature PauseMovement, and use it when necessary change log level on DelayedDelete
This commit is contained in:
@@ -144,6 +144,7 @@ void SmartAI::PausePath(uint32 delay, bool forced)
|
||||
_waypointPauseForced = forced;
|
||||
SetRun(mRun);
|
||||
me->PauseMovement();
|
||||
me->SetHomePosition(me->GetPosition());
|
||||
}
|
||||
else
|
||||
_waypointReached = false;
|
||||
@@ -407,6 +408,7 @@ void SmartAI::WaypointReached(uint32 nodeId, uint32 pathId)
|
||||
{
|
||||
_waypointReached = true;
|
||||
me->PauseMovement();
|
||||
me->SetHomePosition(me->GetPosition());
|
||||
}
|
||||
else if (HasEscortState(SMART_ESCORT_ESCORTING) && me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
|
||||
{
|
||||
|
||||
@@ -313,13 +313,6 @@ void Creature::DisappearAndDie()
|
||||
ForcedDespawn(0);
|
||||
}
|
||||
|
||||
void Creature::PauseMovement(uint32 timer/* = 0*/, uint8 slot/* = 0*/)
|
||||
{
|
||||
Unit::PauseMovement(timer, slot);
|
||||
|
||||
SetHomePosition(GetPosition());
|
||||
}
|
||||
|
||||
bool Creature::IsReturningHome() const
|
||||
{
|
||||
if (GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == HOME_MOTION_TYPE)
|
||||
|
||||
@@ -297,7 +297,6 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
|
||||
uint32 GetCurrentWaypointID() const { return m_waypointID; }
|
||||
void UpdateWaypointID(uint32 wpID) { m_waypointID = wpID; }
|
||||
|
||||
void PauseMovement(uint32 timer = 0, uint8 slot = 0) override; // timer in ms
|
||||
bool IsReturningHome() const;
|
||||
|
||||
void SearchFormation();
|
||||
|
||||
@@ -1794,8 +1794,8 @@ class TC_GAME_API Unit : public WorldObject
|
||||
|
||||
bool IsStopped() const { return !(HasUnitState(UNIT_STATE_MOVING)); }
|
||||
void StopMoving();
|
||||
virtual void PauseMovement(uint32 timer = 0, uint8 slot = 0); // timer in ms
|
||||
void ResumeMovement(uint32 timer = 0, uint8 slot = 0);
|
||||
void PauseMovement(uint32 timer = 0, uint8 slot = 0); // timer in ms
|
||||
void ResumeMovement(uint32 timer = 0, uint8 slot = 0); // timer in ms
|
||||
|
||||
void AddUnitMovementFlag(uint32 f) { m_movementInfo.flags |= f; }
|
||||
void RemoveUnitMovementFlag(uint32 f) { m_movementInfo.flags &= ~f; }
|
||||
|
||||
@@ -52,6 +52,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket& recvData)
|
||||
|
||||
// Stop the npc if moving
|
||||
unit->PauseMovement(sWorld->getIntConfig(CONFIG_CREATURE_STOP_FOR_PLAYER));
|
||||
unit->SetHomePosition(unit->GetPosition());
|
||||
|
||||
BattlegroundTypeId bgTypeId = sBattlegroundMgr->GetBattleMasterBG(unit->GetEntry());
|
||||
|
||||
|
||||
@@ -616,6 +616,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid)
|
||||
|
||||
// Stop the npc if moving
|
||||
vendor->PauseMovement(sWorld->getIntConfig(CONFIG_CREATURE_STOP_FOR_PLAYER));
|
||||
vendor->SetHomePosition(vendor->GetPosition());
|
||||
|
||||
VendorItemData const* items = vendor->GetVendorItems();
|
||||
if (!items)
|
||||
|
||||
@@ -325,6 +325,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
|
||||
|
||||
// Stop the npc if moving
|
||||
unit->PauseMovement(sWorld->getIntConfig(CONFIG_CREATURE_STOP_FOR_PLAYER));
|
||||
unit->SetHomePosition(unit->GetPosition());
|
||||
|
||||
// If spiritguide, no need for gossip menu, just put player into resurrect queue
|
||||
if (unit->IsSpiritGuide())
|
||||
|
||||
@@ -94,6 +94,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket& recvData)
|
||||
|
||||
// Stop the npc if moving
|
||||
creature->PauseMovement(sWorld->getIntConfig(CONFIG_CREATURE_STOP_FOR_PLAYER));
|
||||
creature->SetHomePosition(creature->GetPosition());
|
||||
|
||||
_player->PlayerTalkClass->ClearMenus();
|
||||
if (creature->AI()->GossipHello(_player))
|
||||
|
||||
@@ -861,7 +861,7 @@ void MotionMaster::DirectDelete(MovementGenerator* curr)
|
||||
|
||||
void MotionMaster::DelayedDelete(MovementGenerator* curr)
|
||||
{
|
||||
TC_LOG_FATAL("misc", "Unit (Entry %u) is trying to delete its updating Movement Generator (Type %u)!", _owner->GetEntry(), curr->GetMovementGeneratorType());
|
||||
TC_LOG_DEBUG("misc", "MotionMaster::DelayedDelete: unit (%u) delayed deleting movement generator (type %u)", _owner->GetEntry(), curr->GetMovementGeneratorType());
|
||||
if (IsStatic(curr))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user