mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 01:29:07 +00:00
fix(Core/Misc): Change const to be after type name (#10591)
This commit is contained in:
@@ -1191,7 +1191,7 @@ InstanceScript* WorldObject::GetInstanceScript() const
|
||||
return map->IsDungeon() ? map->ToInstanceMap()->GetInstanceScript() : nullptr;
|
||||
}
|
||||
|
||||
float WorldObject::GetDistanceZ(const WorldObject* obj) const
|
||||
float WorldObject::GetDistanceZ(WorldObject const* obj) const
|
||||
{
|
||||
float dz = std::fabs(GetPositionZ() - obj->GetPositionZ());
|
||||
float sizefactor = GetObjectSize() + obj->GetObjectSize();
|
||||
@@ -1238,7 +1238,7 @@ Position WorldObject::GetHitSpherePointFor(Position const& dest) const
|
||||
return Position(contactPoint.x, contactPoint.y, contactPoint.z, GetAngle(contactPoint.x, contactPoint.y));
|
||||
}
|
||||
|
||||
float WorldObject::GetDistance(const WorldObject* obj) const
|
||||
float WorldObject::GetDistance(WorldObject const* obj) const
|
||||
{
|
||||
float d = GetExactDist(obj) - GetObjectSize() - obj->GetObjectSize();
|
||||
return d > 0.0f ? d : 0.0f;
|
||||
@@ -1256,7 +1256,7 @@ float WorldObject::GetDistance(const WorldObject* obj) const
|
||||
return d > 0.0f ? d : 0.0f;
|
||||
}
|
||||
|
||||
float WorldObject::GetDistance2d(const WorldObject* obj) const
|
||||
float WorldObject::GetDistance2d(WorldObject const* obj) const
|
||||
{
|
||||
float d = GetExactDist2d(obj) - GetObjectSize() - obj->GetObjectSize();
|
||||
return d > 0.0f ? d : 0.0f;
|
||||
@@ -1268,7 +1268,7 @@ float WorldObject::GetDistance2d(const WorldObject* obj) const
|
||||
return d > 0.0f ? d : 0.0f;
|
||||
}
|
||||
|
||||
bool WorldObject::IsSelfOrInSameMap(const WorldObject* obj) const
|
||||
bool WorldObject::IsSelfOrInSameMap(WorldObject const* obj) const
|
||||
{
|
||||
if (this == obj)
|
||||
{
|
||||
@@ -1278,7 +1278,7 @@ bool WorldObject::IsSelfOrInSameMap(const WorldObject* obj) const
|
||||
return IsInMap(obj);
|
||||
}
|
||||
|
||||
bool WorldObject::IsInMap(const WorldObject* obj) const
|
||||
bool WorldObject::IsInMap(WorldObject const* obj) const
|
||||
{
|
||||
if (obj)
|
||||
{
|
||||
@@ -1340,7 +1340,7 @@ bool WorldObject::IsWithinLOS(float ox, float oy, float oz, LineOfSightChecks ch
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WorldObject::IsWithinLOSInMap(const WorldObject* obj, LineOfSightChecks checks) const
|
||||
bool WorldObject::IsWithinLOSInMap(WorldObject const* obj, LineOfSightChecks checks) const
|
||||
{
|
||||
if (!IsInMap(obj))
|
||||
return false;
|
||||
@@ -1463,7 +1463,7 @@ bool WorldObject::IsInRange3d(float x, float y, float z, float minRange, float m
|
||||
return distsq < maxdist * maxdist;
|
||||
}
|
||||
|
||||
bool WorldObject::IsInBetween(const WorldObject* obj1, const WorldObject* obj2, float size) const
|
||||
bool WorldObject::IsInBetween(WorldObject const* obj1, WorldObject const* obj2, float size) const
|
||||
{
|
||||
if (!obj1 || !obj2)
|
||||
return false;
|
||||
@@ -1665,7 +1665,7 @@ float WorldObject::GetVisibilityRange() const
|
||||
return IsInWintergrasp() ? VISIBILITY_DIST_WINTERGRASP : GetMap()->GetVisibilityRange();
|
||||
}
|
||||
|
||||
float WorldObject::GetSightRange(const WorldObject* target) const
|
||||
float WorldObject::GetSightRange(WorldObject const* target) const
|
||||
{
|
||||
if (ToUnit())
|
||||
{
|
||||
@@ -1756,7 +1756,7 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
||||
|
||||
// pussywizard: arena spectator
|
||||
if (obj->GetTypeId() == TYPEID_PLAYER)
|
||||
if (((const Player*)obj)->IsSpectator() && ((const Player*)obj)->FindMap()->IsBattleArena())
|
||||
if (((Player const*)obj)->IsSpectator() && ((Player const*)obj)->FindMap()->IsBattleArena())
|
||||
return false;
|
||||
|
||||
bool corpseVisibility = false;
|
||||
@@ -1841,7 +1841,7 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
||||
|
||||
// pussywizard: arena spectator
|
||||
if (this->GetTypeId() == TYPEID_PLAYER)
|
||||
if (((const Player*)this)->IsSpectator() && ((const Player*)this)->FindMap()->IsBattleArena() && (obj->m_invisibility.GetFlags() || obj->m_stealth.GetFlags()))
|
||||
if (((Player const*)this)->IsSpectator() && ((Player const*)this)->FindMap()->IsBattleArena() && (obj->m_invisibility.GetFlags() || obj->m_stealth.GetFlags()))
|
||||
return false;
|
||||
|
||||
if (!CanDetect(obj, ignoreStealth, !distanceCheck, checkAlert))
|
||||
@@ -1859,10 +1859,10 @@ bool WorldObject::CanNeverSee(WorldObject const* obj) const
|
||||
|
||||
bool WorldObject::CanDetect(WorldObject const* obj, bool ignoreStealth, bool checkClient, bool checkAlert) const
|
||||
{
|
||||
const WorldObject* seer = this;
|
||||
WorldObject const* seer = this;
|
||||
|
||||
// Pets don't have detection, they use the detection of their masters
|
||||
if (const Unit* thisUnit = ToUnit())
|
||||
if (Unit const* thisUnit = ToUnit())
|
||||
if (Unit* controller = thisUnit->GetCharmerOrOwner())
|
||||
seer = controller;
|
||||
|
||||
@@ -2619,7 +2619,7 @@ void WorldObject::GetVoidClosePoint(float& x, float& y, float& z, float size, fl
|
||||
GetNearPoint(nullptr, x, y, z, size, distance2d, GetOrientation() + relAngle, controlZ);
|
||||
}
|
||||
|
||||
bool WorldObject::GetClosePoint(float& x, float& y, float& z, float size, float distance2d, float angle, const WorldObject* forWho, bool force) const
|
||||
bool WorldObject::GetClosePoint(float& x, float& y, float& z, float size, float distance2d, float angle, WorldObject const* forWho, bool force) const
|
||||
{
|
||||
// angle calculated from current orientation
|
||||
GetNearPoint(forWho, x, y, z, size, distance2d, GetOrientation() + angle);
|
||||
@@ -2630,7 +2630,7 @@ bool WorldObject::GetClosePoint(float& x, float& y, float& z, float size, float
|
||||
y = this->GetPositionY();
|
||||
z = this->GetPositionZ();
|
||||
if (forWho)
|
||||
if (const Unit* u = forWho->ToUnit())
|
||||
if (Unit const* u = forWho->ToUnit())
|
||||
u->UpdateAllowedPositionZ(x, y, z);
|
||||
}
|
||||
float maxDist = GetObjectSize() + size + distance2d + 1.0f;
|
||||
@@ -2662,7 +2662,7 @@ Position WorldObject::GetRandomNearPosition(float radius)
|
||||
return pos;
|
||||
}
|
||||
|
||||
void WorldObject::GetContactPoint(const WorldObject* obj, float& x, float& y, float& z, float distance2d) const
|
||||
void WorldObject::GetContactPoint(WorldObject const* obj, float& x, float& y, float& z, float distance2d) const
|
||||
{
|
||||
// angle to face `obj` to `this` using distance includes size of `obj`
|
||||
GetNearPoint(obj, x, y, z, obj->GetObjectSize(), distance2d, GetAngle(obj));
|
||||
@@ -2677,7 +2677,7 @@ void WorldObject::GetContactPoint(const WorldObject* obj, float& x, float& y, fl
|
||||
}
|
||||
}
|
||||
|
||||
void WorldObject::GetChargeContactPoint(const WorldObject* obj, float& x, float& y, float& z, float distance2d) const
|
||||
void WorldObject::GetChargeContactPoint(WorldObject const* obj, float& x, float& y, float& z, float distance2d) const
|
||||
{
|
||||
// angle to face `obj` to `this` using distance includes size of `obj`
|
||||
GetNearPoint(obj, x, y, z, obj->GetObjectSize(), distance2d, GetAngle(obj));
|
||||
|
||||
Reference in New Issue
Block a user