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:
ccrs
2017-08-12 17:35:46 +02:00
parent e2565c2597
commit cd4775420a
9 changed files with 9 additions and 11 deletions

View File

@@ -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)
{

View File

@@ -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)

View File

@@ -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();

View File

@@ -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; }

View File

@@ -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());

View File

@@ -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)

View File

@@ -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())

View File

@@ -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))

View File

@@ -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;