mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 17:13:47 +00:00
fix(CORE): Missing override on various functions (#2602)
This commit is contained in:
@@ -1450,7 +1450,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
|
||||
bool canSwim = ToCreature()->CanSwim();
|
||||
float ground_z = z;
|
||||
float max_z = canSwim
|
||||
? GetMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK))
|
||||
? GetMap()->GetWaterOrGroundLevel(GetPhaseMask(), x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK))
|
||||
: ((ground_z = GetMap()->GetHeight(GetPhaseMask(), x, y, z, true)));
|
||||
if (max_z > INVALID_HEIGHT)
|
||||
{
|
||||
@@ -1474,7 +1474,7 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
|
||||
if (!ToPlayer()->CanFly())
|
||||
{
|
||||
float ground_z = z;
|
||||
float max_z = GetMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK));
|
||||
float max_z = GetMap()->GetWaterOrGroundLevel(GetPhaseMask(),x, y, z, &ground_z, !ToUnit()->HasAuraType(SPELL_AURA_WATER_WALK));
|
||||
if (max_z > INVALID_HEIGHT)
|
||||
{
|
||||
if (z > max_z)
|
||||
@@ -2515,7 +2515,7 @@ void WorldObject::GetNearPoint2D(float &x, float &y, float distance2d, float abs
|
||||
acore::NormalizeMapCoord(y);
|
||||
}
|
||||
|
||||
void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const
|
||||
void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle, float controlZ) const
|
||||
{
|
||||
GetNearPoint2D(x, y, distance2d+searcher_size, absAngle);
|
||||
z = GetPositionZ();
|
||||
@@ -2529,7 +2529,7 @@ void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y,
|
||||
return;
|
||||
|
||||
// return if the point is already in LoS
|
||||
if (IsWithinLOS(x, y, z))
|
||||
if (!controlZ && IsWithinLOS(x, y, z))
|
||||
return;
|
||||
|
||||
// remember first point
|
||||
@@ -2543,6 +2543,9 @@ void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y,
|
||||
GetNearPoint2D(x, y, distance2d + searcher_size, absAngle + angle);
|
||||
z = GetPositionZ();
|
||||
UpdateAllowedPositionZ(x, y, z);
|
||||
if (controlZ && fabsf(GetPositionZ() - z) > controlZ)
|
||||
continue;
|
||||
|
||||
if (IsWithinLOS(x, y, z))
|
||||
return;
|
||||
}
|
||||
@@ -2553,6 +2556,12 @@ void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y,
|
||||
z = first_z;
|
||||
}
|
||||
|
||||
void WorldObject::GetVoidClosePoint(float& x, float& y, float& z, float size, float distance2d /*= 0*/, float relAngle /*= 0*/, float controlZ /*= 0*/) const
|
||||
{
|
||||
// angle calculated from current orientation
|
||||
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
|
||||
{
|
||||
// angle calculated from current orientation
|
||||
|
||||
@@ -747,7 +747,8 @@ class WorldObject : public Object, public WorldLocation
|
||||
#endif
|
||||
|
||||
void GetNearPoint2D(float &x, float &y, float distance, float absAngle) const;
|
||||
void GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const;
|
||||
void GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle, float controlZ = 0) const;
|
||||
void GetVoidClosePoint(float& x, float& y, float& z, float size, float distance2d = 0, float relAngle = 0, float controlZ = 0) const;
|
||||
bool GetClosePoint(float &x, float &y, float &z, float size, float distance2d = 0, float angle = 0, const WorldObject* forWho = NULL, bool force = false) const;
|
||||
void MovePosition(Position &pos, float dist, float angle);
|
||||
void GetNearPosition(Position &pos, float dist, float angle)
|
||||
@@ -780,6 +781,8 @@ class WorldObject : public Object, public WorldLocation
|
||||
{
|
||||
return (m_valuesCount > UNIT_FIELD_COMBATREACH) ? m_floatValues[UNIT_FIELD_COMBATREACH] : DEFAULT_WORLD_OBJECT_SIZE;
|
||||
}
|
||||
|
||||
virtual float GetCombatReach() const { return 0.0f; } // overridden (only) in Unit
|
||||
void UpdateGroundPositionZ(float x, float y, float &z) const;
|
||||
void UpdateAllowedPositionZ(float x, float y, float &z) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user