fix(CORE): Missing override on various functions (#2602)

This commit is contained in:
Nefertumm
2020-01-21 19:03:15 -03:00
committed by GitHub
parent b66ec5712e
commit 59234f8f4b
16 changed files with 193 additions and 166 deletions

View File

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