mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Movement: 7fff83d675 followup
remove home position set from creature PauseMovement, and use it when necessary
change log level on DelayedDelete
(cherry picked from commit cd4775420a)
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)
|
||||
{
|
||||
|
||||
@@ -356,13 +356,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)
|
||||
|
||||
@@ -296,7 +296,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();
|
||||
|
||||
@@ -1909,8 +1909,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.AddMovementFlag(f); }
|
||||
void RemoveUnitMovementFlag(uint32 f) { m_movementInfo.RemoveMovementFlag(f); }
|
||||
|
||||
@@ -48,6 +48,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPackets::NPC::Hello& hello
|
||||
|
||||
// Stop the npc if moving
|
||||
unit->PauseMovement(sWorld->getIntConfig(CONFIG_CREATURE_STOP_FOR_PLAYER));
|
||||
unit->SetHomePosition(unit->GetPosition());
|
||||
|
||||
BattlegroundTypeId bgTypeId = sBattlegroundMgr->GetBattleMasterBG(unit->GetEntry());
|
||||
|
||||
|
||||
@@ -601,6 +601,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* vendorItems = vendor->GetVendorItems();
|
||||
uint32 rawItemCount = vendorItems ? vendorItems->GetItemCount() : 0;
|
||||
|
||||
@@ -170,6 +170,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPackets::NPC::Hello& packet)
|
||||
|
||||
// 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())
|
||||
|
||||
@@ -90,6 +90,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPackets::Quest::QuestGiverHe
|
||||
|
||||
// Stop the npc if moving
|
||||
creature->PauseMovement(sWorld->getIntConfig(CONFIG_CREATURE_STOP_FOR_PLAYER));
|
||||
creature->SetHomePosition(creature->GetPosition());
|
||||
|
||||
_player->PlayerTalkClass->ClearMenus();
|
||||
if (creature->GetAI()->GossipHello(_player))
|
||||
|
||||
@@ -878,7 +878,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