mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
@@ -241,7 +241,7 @@ void MotionMaster::MoveRandom(float wanderDistance)
|
||||
if (_owner->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Creature (GUID: %u) start moving random", _owner->GetGUIDLow());
|
||||
LOG_DEBUG("server", "Creature (%s) start moving random", _owner->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Mutate(new RandomMovementGenerator<Creature>(wanderDistance), MOTION_SLOT_IDLE);
|
||||
}
|
||||
@@ -254,7 +254,7 @@ void MotionMaster::MoveTargetedHome()
|
||||
if (_owner->GetTypeId() == TYPEID_UNIT && !_owner->ToCreature()->GetCharmerOrOwnerGUID())
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Creature (Entry: %u GUID: %u) targeted home", _owner->GetEntry(), _owner->GetGUIDLow());
|
||||
LOG_DEBUG("server", "Creature (%s) targeted home", _owner->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Mutate(new HomeMovementGenerator<Creature>(), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
@@ -266,20 +266,20 @@ void MotionMaster::MoveTargetedHome()
|
||||
return;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow());
|
||||
LOG_DEBUG("server", "Pet or controlled creature (%s) targeting home", _owner->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Unit* target = _owner->ToCreature()->GetCharmerOrOwner();
|
||||
if (target)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow());
|
||||
LOG_DEBUG("server", "Following %s (%s)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Mutate(new FollowMovementGenerator<Creature>(target, PET_FOLLOW_DIST, _owner->GetFollowAngle()), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("server", "Player (GUID: %u) attempt targeted home", _owner->GetGUIDLow());
|
||||
LOG_ERROR("server", "Player (%s) attempt targeted home", _owner->GetGUID().ToString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,14 +292,14 @@ void MotionMaster::MoveConfused()
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Player (GUID: %u) move confused", _owner->GetGUIDLow());
|
||||
LOG_DEBUG("server", "Player (%s) move confused", _owner->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Mutate(new ConfusedMovementGenerator<Player>(), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Creature (Entry: %u GUID: %u) move confused", _owner->GetEntry(), _owner->GetGUIDLow());
|
||||
LOG_DEBUG("server", "Creature (%s) move confused", _owner->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Mutate(new ConfusedMovementGenerator<Creature>(), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
@@ -316,20 +316,16 @@ void MotionMaster::MoveChase(Unit* target, std::optional<ChaseRange> dist, std:
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Player (GUID: %u) chase to %s (GUID: %u)",
|
||||
_owner->GetGUIDLow(),
|
||||
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
|
||||
LOG_DEBUG("server", "Player (%s) chase to %s (%s)",
|
||||
_owner->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Mutate(new ChaseMovementGenerator<Player>(target, dist, angle), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)",
|
||||
_owner->GetEntry(), _owner->GetGUIDLow(),
|
||||
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
|
||||
LOG_DEBUG("server", "Creature (%s) chase to %s (%s)",
|
||||
_owner->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Mutate(new ChaseMovementGenerator<Creature>(target, dist, angle), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
@@ -394,19 +390,16 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUIDLow(),
|
||||
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
|
||||
LOG_DEBUG("server", "Player (%s) follow to %s (%s)",
|
||||
_owner->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Mutate(new FollowMovementGenerator<Player>(target, dist, angle), slot);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)",
|
||||
_owner->GetEntry(), _owner->GetGUIDLow(),
|
||||
target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow());
|
||||
LOG_DEBUG("server", "Creature (%s) follow to %s (%s)",
|
||||
_owner->GetGUID().ToString().c_str(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Mutate(new FollowMovementGenerator<Creature>(target, dist, angle), slot);
|
||||
}
|
||||
@@ -421,15 +414,14 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generate
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z);
|
||||
LOG_DEBUG("server", "Player (%s) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUID().ToString().c_str(), id, x, y, z);
|
||||
#endif
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z, 0.0f, orientation, nullptr, generatePath, forceDestination), slot);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)",
|
||||
_owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z);
|
||||
LOG_DEBUG("server", "Creature (%s) targeted point (ID: %u X: %f Y: %f Z: %f)", _owner->GetGUID().ToString().c_str(), id, x, y, z);
|
||||
#endif
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, 0.0f, orientation, nullptr, generatePath, forceDestination), slot);
|
||||
}
|
||||
@@ -558,7 +550,7 @@ void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ)
|
||||
void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id, Unit const* target)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z);
|
||||
LOG_DEBUG("server", "Unit (%s) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUID().ToString().c_str(), x, y, z);
|
||||
#endif
|
||||
|
||||
if (speedXY <= 0.1f)
|
||||
@@ -632,15 +624,14 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id,
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z);
|
||||
LOG_DEBUG("server", "Player (%s) charge point (X: %f Y: %f Z: %f)", _owner->GetGUID().ToString().c_str(), x, y, z);
|
||||
#endif
|
||||
Mutate(new PointMovementGenerator<Player>(id, x, y, z, speed, orientation, path, generatePath, generatePath), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)",
|
||||
_owner->GetEntry(), _owner->GetGUIDLow(), x, y, z);
|
||||
LOG_DEBUG("server", "Creature (%s) charge point (X: %f Y: %f Z: %f)", _owner->GetGUID().ToString().c_str(), x, y, z);
|
||||
#endif
|
||||
Mutate(new PointMovementGenerator<Creature>(id, x, y, z, speed, orientation, path, generatePath, generatePath), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
@@ -654,13 +645,12 @@ void MotionMaster::MoveSeekAssistance(float x, float y, float z)
|
||||
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
LOG_ERROR("server", "Player (GUID: %u) attempt to seek assistance", _owner->GetGUIDLow());
|
||||
LOG_ERROR("server", "Player (%s) attempt to seek assistance", _owner->GetGUID().ToString().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)",
|
||||
_owner->GetEntry(), _owner->GetGUIDLow(), x, y, z);
|
||||
LOG_DEBUG("server", "Creature (%s) seek assistance (X: %f Y: %f Z: %f)", _owner->GetGUID().ToString().c_str(), x, y, z);
|
||||
#endif
|
||||
_owner->AttackStop();
|
||||
_owner->CastStop(0, false);
|
||||
@@ -677,13 +667,12 @@ void MotionMaster::MoveSeekAssistanceDistract(uint32 time)
|
||||
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
LOG_ERROR("server", "Player (GUID: %u) attempt to call distract after assistance", _owner->GetGUIDLow());
|
||||
LOG_ERROR("server", "Player (%s) attempt to call distract after assistance", _owner->GetGUID().ToString().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)",
|
||||
_owner->GetEntry(), _owner->GetGUIDLow(), time);
|
||||
LOG_DEBUG("server", "Creature (%s) is distracted after assistance call (Time: %u)", _owner->GetGUID().ToString().c_str(), time);
|
||||
#endif
|
||||
Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
@@ -701,20 +690,16 @@ void MotionMaster::MoveFleeing(Unit* enemy, uint32 time)
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Player (GUID: %u) flee from %s (GUID: %u)", _owner->GetGUIDLow(),
|
||||
enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow());
|
||||
LOG_DEBUG("server", "Player (%s) flee from %s (%s)",
|
||||
_owner->GetGUID().ToString().c_str(), enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", enemy->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
Mutate(new FleeingMovementGenerator<Player>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s",
|
||||
_owner->GetEntry(), _owner->GetGUIDLow(),
|
||||
enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
|
||||
enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow(),
|
||||
time ? " for a limited time" : "");
|
||||
LOG_DEBUG("server", "Creature (%s) flee from %s (%s) %s",
|
||||
_owner->GetGUID().ToString().c_str(), enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", enemy->GetGUID().ToString().c_str(), time ? " for a limited time" : "");
|
||||
#endif
|
||||
if (time)
|
||||
Mutate(new TimedFleeingMovementGenerator(enemy->GetGUID(), time), MOTION_SLOT_CONTROLLED);
|
||||
@@ -744,8 +729,7 @@ void MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode)
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("server", "Creature (Entry: %u GUID: %u) attempt taxi to (Path %u node %u)",
|
||||
_owner->GetEntry(), _owner->GetGUIDLow(), path, pathnode);
|
||||
LOG_ERROR("server", "Creature (%s) attempt taxi to (Path %u node %u)", _owner->GetGUID().ToString().c_str(), path, pathnode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -761,15 +745,14 @@ void MotionMaster::MoveDistract(uint32 timer)
|
||||
/*if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Player (GUID: %u) distracted (timer: %u)", _owner->GetGUIDLow(), timer);
|
||||
LOG_DEBUG("server", "Player (%s) distracted (timer: %u)", _owner->GetGUID().ToString().c_str(), timer);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "Creature (Entry: %u GUID: %u) (timer: %u)",
|
||||
LOG_DEBUG("server", "Creature (%s) (timer: %u)", _owner->GetGUID().ToString().c_str(), timer);
|
||||
#endif
|
||||
_owner->GetEntry(), _owner->GetGUIDLow(), timer);
|
||||
}*/
|
||||
|
||||
DistractMovementGenerator* mgen = new DistractMovementGenerator(timer);
|
||||
@@ -831,9 +814,8 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable)
|
||||
Mutate(new WaypointMovementGenerator<Creature>(path_id, repeatable), MOTION_SLOT_IDLE);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("server", "%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)",
|
||||
_owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature",
|
||||
_owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO");
|
||||
LOG_DEBUG("server", "%s (%s) start moving over path(Id:%u, repeatable: %s)",
|
||||
_owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature", _owner->GetGUID().ToString().c_str(), path_id, repeatable ? "YES" : "NO");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ template<class T>
|
||||
class FleeingMovementGenerator : public MovementGeneratorMedium< T, FleeingMovementGenerator<T> >
|
||||
{
|
||||
public:
|
||||
FleeingMovementGenerator(uint64 fright) : i_frightGUID(fright), i_nextCheckTime(0) {}
|
||||
FleeingMovementGenerator(ObjectGuid fright) : i_frightGUID(fright), i_nextCheckTime(0) {}
|
||||
|
||||
void DoInitialize(T*);
|
||||
void DoFinalize(T*);
|
||||
@@ -38,14 +38,14 @@ private:
|
||||
float i_last_distance_from_caster;
|
||||
float i_to_distance_from_caster;
|
||||
float i_cur_angle;
|
||||
uint64 i_frightGUID;
|
||||
ObjectGuid i_frightGUID;
|
||||
TimeTracker i_nextCheckTime;
|
||||
};
|
||||
|
||||
class TimedFleeingMovementGenerator : public FleeingMovementGenerator<Creature>
|
||||
{
|
||||
public:
|
||||
TimedFleeingMovementGenerator(uint64 fright, uint32 time) :
|
||||
TimedFleeingMovementGenerator(ObjectGuid fright, uint32 time) :
|
||||
FleeingMovementGenerator<Creature>(fright),
|
||||
i_totalFleeTime(time) {}
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con
|
||||
// this is probably an error state, but we'll leave it
|
||||
// and hopefully recover on the next Update
|
||||
// we still need to copy our preffix
|
||||
LOG_ERROR("server", "PathGenerator::BuildPolyPath: Path Build failed %u", _source->GetGUIDLow());
|
||||
LOG_ERROR("server", "PathGenerator::BuildPolyPath: Path Build failed %s", _source->GetGUID().ToString().c_str());
|
||||
}
|
||||
|
||||
// new path = prefix + suffix - overlap
|
||||
@@ -470,7 +470,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con
|
||||
if (!_polyLength || dtStatusFailed(dtResult))
|
||||
{
|
||||
// only happens if we passed bad data to findPath(), or navmesh is messed up
|
||||
LOG_ERROR("server", "PathGenerator::BuildPolyPath: %u Path Build failed: 0 length path", _source->GetGUIDLow());
|
||||
LOG_ERROR("server", "PathGenerator::BuildPolyPath: %s Path Build failed: 0 length path", _source->GetGUID().ToString().c_str());
|
||||
BuildShortcut();
|
||||
_type = PATHFIND_NOPATH;
|
||||
return;
|
||||
@@ -479,7 +479,7 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con
|
||||
|
||||
if (!_polyLength)
|
||||
{
|
||||
LOG_ERROR("server", "PathGenerator::BuildPolyPath: %u Path Build failed: 0 length path", _source->GetGUIDLow());
|
||||
LOG_ERROR("server", "PathGenerator::BuildPolyPath: %s Path Build failed: 0 length path", _source->GetGUID().ToString().c_str());
|
||||
BuildShortcut();
|
||||
_type = PATHFIND_NOPATH;
|
||||
return;
|
||||
@@ -509,7 +509,7 @@ void PathGenerator::BuildPointPath(const float* startPoint, const float* endPoin
|
||||
if (_useRaycast)
|
||||
{
|
||||
// _straightLine uses raycast and it currently doesn't support building a point path, only a 2-point path with start and hitpoint/end is returned
|
||||
LOG_ERROR("server", "PathGenerator::BuildPointPath() called with _useRaycast for unit %u", _source->GetGUIDLow());
|
||||
LOG_ERROR("server", "PathGenerator::BuildPointPath() called with _useRaycast for unit %s", _source->GetGUID().ToString().c_str());
|
||||
BuildShortcut();
|
||||
_type = PATHFIND_NOPATH;
|
||||
return;
|
||||
@@ -893,7 +893,8 @@ dtStatus PathGenerator::FindSmoothPath(float const* startPos, float const* endPo
|
||||
npolys = FixupCorridor(polys, npolys, MAX_PATH_LENGTH, visited, nvisited);
|
||||
|
||||
if (dtStatusFailed(_navMeshQuery->getPolyHeight(polys[0], result, &result[1])))
|
||||
LOG_DEBUG("maps", "PathGenerator::FindSmoothPath: Cannot find height at position X: %f Y: %f Z: %f for %u", result[2], result[0], result[1], _source->GetGUIDLow());
|
||||
LOG_DEBUG("maps", "PathGenerator::FindSmoothPath: Cannot find height at position X: %f Y: %f Z: %f for %s",
|
||||
result[2], result[0], result[1], _source->GetGUID().ToString().c_str());
|
||||
result[1] += 0.5f;
|
||||
dtVcopy(iterPos, result);
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ void RandomMovementGenerator<Creature>::DoInitialize(Creature* creature)
|
||||
if (!_wanderDistance)
|
||||
_wanderDistance = creature->GetWanderDistance();
|
||||
|
||||
_nextMoveTime.Reset(creature->GetDBTableGUIDLow() && creature->GetWanderDistance() == _wanderDistance ? urand(1, 5000) : 0);
|
||||
_nextMoveTime.Reset(creature->GetSpawnId() && creature->GetWanderDistance() == _wanderDistance ? urand(1, 5000) : 0);
|
||||
_wanderDistance = std::max((creature->GetWanderDistance() == _wanderDistance && creature->GetInstanceId() == 0) ? (creature->CanFly() ? MIN_WANDER_DISTANCE_AIR : MIN_WANDER_DISTANCE_GROUND) : 0.0f, _wanderDistance);
|
||||
|
||||
if (G3D::fuzzyEq(_initialPosition.GetExactDist2d(0.0f, 0.0f), 0.0f))
|
||||
|
||||
@@ -222,7 +222,7 @@ void ChaseMovementGenerator<T>::MovementInform(T* owner)
|
||||
|
||||
// Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle
|
||||
if (CreatureAI* AI = owner->ToCreature()->AI())
|
||||
AI->MovementInform(CHASE_MOTION_TYPE, i_target.getTarget()->GetGUIDLow());
|
||||
AI->MovementInform(CHASE_MOTION_TYPE, i_target.getTarget()->GetGUID().GetCounter());
|
||||
}
|
||||
|
||||
//-----------------------------------------------//
|
||||
@@ -365,7 +365,7 @@ void FollowMovementGenerator<Creature>::_updateSpeed(Creature* owner)
|
||||
{
|
||||
// pet only sync speed with owner
|
||||
/// Make sure we are not in the process of a map change (IsInWorld)
|
||||
if (!IS_PLAYER_GUID(owner->GetOwnerGUID()) || !owner->IsInWorld() || !i_target.isValid() || i_target->GetGUID() != owner->GetOwnerGUID())
|
||||
if (!owner->GetOwnerGUID().IsPlayer() || !owner->IsInWorld() || !i_target.isValid() || i_target->GetGUID() != owner->GetOwnerGUID())
|
||||
return;
|
||||
|
||||
owner->UpdateSpeed(MOVE_RUN, true);
|
||||
@@ -402,7 +402,7 @@ void FollowMovementGenerator<T>::MovementInform(T* owner)
|
||||
|
||||
// Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle
|
||||
if (CreatureAI* AI = owner->ToCreature()->AI())
|
||||
AI->MovementInform(FOLLOW_MOTION_TYPE, i_target.getTarget()->GetGUIDLow());
|
||||
AI->MovementInform(FOLLOW_MOTION_TYPE, i_target.getTarget()->GetGUID().GetCounter());
|
||||
}
|
||||
|
||||
//-----------------------------------------------//
|
||||
|
||||
@@ -27,7 +27,8 @@ void WaypointMovementGenerator<Creature>::LoadPath(Creature* creature)
|
||||
if (!i_path)
|
||||
{
|
||||
// No movement found for entry
|
||||
LOG_ERROR("sql.sql", "WaypointMovementGenerator::LoadPath: creature %s (Entry: %u GUID: %u) doesn't have waypoint path id: %u", creature->GetName().c_str(), creature->GetEntry(), creature->GetGUIDLow(), path_id);
|
||||
LOG_ERROR("sql.sql", "WaypointMovementGenerator::LoadPath: creature %s (%s) doesn't have waypoint path id: %u",
|
||||
creature->GetName().c_str(), creature->GetGUID().ToString().c_str(), path_id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -65,7 +66,8 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature* creature)
|
||||
if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("maps.script", "Creature movement start script %u at point %u for " UI64FMTD ".", i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID());
|
||||
LOG_DEBUG("maps.script", "Creature movement start script %u at point %u for %s.",
|
||||
i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID().ToString().c_str());
|
||||
#endif
|
||||
creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE);
|
||||
creature->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, creature, nullptr);
|
||||
@@ -363,7 +365,8 @@ bool FlightPathMovementGenerator::DoUpdate(Player* player, uint32 /*diff*/)
|
||||
{
|
||||
if (i_currentNode >= i_path.size())
|
||||
{
|
||||
LOG_INFO("misc", "TAXI NODE WAS GREATER THAN PATH SIZE, GUID: %u, POINTID: %u, NODESIZE: %lu, CURRENT: %u", player->GetGUIDLow(), pointId, i_path.size(), i_currentNode);
|
||||
LOG_INFO("misc", "TAXI NODE WAS GREATER THAN PATH SIZE, %s, POINTID: %u, NODESIZE: %lu, CURRENT: %u",
|
||||
player->GetGUID().ToString().c_str(), pointId, i_path.size(), i_currentNode);
|
||||
player->CleanupAfterTaxiFlight();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace Movement
|
||||
#define CHECK(exp) \
|
||||
if (!(exp))\
|
||||
{\
|
||||
LOG_ERROR("server", "MoveSplineInitArgs::Validate: expression '%s' failed for GUID: %u Entry: %u", #exp, unit->GetTypeId() == TYPEID_PLAYER ? unit->GetGUIDLow() : unit->ToCreature()->GetDBTableGUIDLow(), unit->GetEntry());\
|
||||
LOG_ERROR("server", "MoveSplineInitArgs::Validate: expression '%s' failed for GUID: %u Entry: %u", #exp, unit->GetTypeId() == TYPEID_PLAYER ? unit->GetGUID().GetCounter() : unit->ToCreature()->GetSpawnId(), unit->GetEntry());\
|
||||
return false;\
|
||||
}
|
||||
CHECK(path.size() > 1);
|
||||
|
||||
@@ -119,11 +119,11 @@ namespace Movement
|
||||
move_spline.Initialize(args);
|
||||
|
||||
WorldPacket data(SMSG_MONSTER_MOVE, 64);
|
||||
data.append(unit->GetPackGUID());
|
||||
data << unit->GetPackGUID();
|
||||
if (transport)
|
||||
{
|
||||
data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT);
|
||||
data.appendPackGUID(unit->GetTransGUID());
|
||||
data << unit->GetTransGUID().WriteAsPacked();
|
||||
data << int8(unit->GetTransSeat());
|
||||
}
|
||||
|
||||
@@ -170,11 +170,11 @@ namespace Movement
|
||||
move_spline.Initialize(args);
|
||||
|
||||
WorldPacket data(SMSG_MONSTER_MOVE, 64);
|
||||
data.append(unit->GetPackGUID());
|
||||
data << unit->GetPackGUID();
|
||||
if (transport)
|
||||
{
|
||||
data.SetOpcode(SMSG_MONSTER_MOVE_TRANSPORT);
|
||||
data.appendPackGUID(unit->GetTransGUID());
|
||||
data << unit->GetTransGUID().WriteAsPacked();
|
||||
data << int8(unit->GetTransSeat());
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace Movement
|
||||
void MoveSplineInit::SetFacing(const Unit* target)
|
||||
{
|
||||
args.flags.EnableFacingTarget();
|
||||
args.facing.target = target->GetGUID();
|
||||
args.facing.target = target->GetGUID().GetRawValue();
|
||||
}
|
||||
|
||||
void MoveSplineInit::SetFacing(float angle)
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace Movement
|
||||
{
|
||||
float x, y, z;
|
||||
} f;
|
||||
uint64 target;
|
||||
float angle;
|
||||
uint64 target;
|
||||
float angle;
|
||||
|
||||
FacingInfo(float o) : angle(o) {}
|
||||
FacingInfo(uint64 t) : target(t) {}
|
||||
|
||||
Reference in New Issue
Block a user