Core/Movement: fixed differences between 335 and 434 branch
This commit is contained in:
1 parent
eb15db4522
commit
8b8568a76a
2 files changed
+15
-10
No files matched your search
@@ -2395,7 +2395,7 @@ void WorldObject::GetNearPoint2D(WorldObject const* searcher, float &x, float &y
|
||||
|
||||
float hoverDelta = myHover - searcherHover;
|
||||
if (hoverDelta != 0.0f)
|
||||
effectiveReach = std::sqrt(effectiveReach * effectiveReach - hoverDelta * hoverDelta);
|
||||
effectiveReach = std::sqrt(std::max(effectiveReach * effectiveReach - hoverDelta * hoverDelta, 0.0f));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2410,8 +2410,7 @@ void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y,
|
||||
{
|
||||
GetNearPoint2D(searcher, x, y, distance2d, absAngle);
|
||||
z = GetPositionZ();
|
||||
// Should "searcher" be used instead of "this" when updating z coordinate ?
|
||||
UpdateAllowedPositionZ(x, y, z);
|
||||
(searcher ? searcher : this)->UpdateAllowedPositionZ(x, y, z);
|
||||
|
||||
// if detection disabled, return first point
|
||||
if (!sWorld->getBoolConfig(CONFIG_DETECT_POS_COLLISION))
|
||||
@@ -2536,9 +2535,12 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
|
||||
return;
|
||||
}
|
||||
|
||||
float halfHeight = GetCollisionHeight() * 0.5f;
|
||||
UpdateAllowedPositionZ(destx, desty, destz);
|
||||
bool col = VMAP::VMapFactory::createOrGetVMapManager()->getObjectHitPos(PhasingHandler::GetTerrainMapId(GetPhaseShift(), GetMap(), pos.m_positionX, pos.m_positionY),
|
||||
pos.m_positionX, pos.m_positionY, pos.m_positionZ, destx, desty, destz, destx, desty, destz, -0.5f);
|
||||
pos.m_positionX, pos.m_positionY, pos.m_positionZ + halfHeight,
|
||||
destx, desty, destz + halfHeight,
|
||||
destx, desty, destz, -0.5f);
|
||||
|
||||
// collision occured
|
||||
if (col)
|
||||
@@ -2550,7 +2552,11 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float
|
||||
}
|
||||
|
||||
// check dynamic collision
|
||||
col = GetMap()->getObjectHitPos(GetPhaseShift(), pos.m_positionX, pos.m_positionY, pos.m_positionZ, destx, desty, destz, destx, desty, destz, -0.5f);
|
||||
col = GetMap()->getObjectHitPos(GetPhaseShift(),
|
||||
pos.m_positionX, pos.m_positionY, pos.m_positionZ + halfHeight,
|
||||
destx, desty, destz + halfHeight,
|
||||
destx, desty, destz, -0.5f);
|
||||
|
||||
|
||||
// Collided with a gameobject
|
||||
if (col)
|
||||
@@ -2772,10 +2778,9 @@ float WorldObject::GetFloorZ() const
|
||||
|
||||
float WorldObject::GetMapWaterOrGroundLevel(float x, float y, float z, float* ground/* = nullptr*/) const
|
||||
{
|
||||
if (Unit const* unit = ToUnit())
|
||||
return GetMap()->GetWaterOrGroundLevel(GetPhaseShift(), x, y, z, ground, !unit->HasAuraType(SPELL_AURA_WATER_WALK), GetCollisionHeight());
|
||||
|
||||
return z;
|
||||
return GetMap()->GetWaterOrGroundLevel(GetPhaseShift(), x, y, z, ground,
|
||||
isType(TYPEMASK_UNIT) ? !static_cast<Unit const*>(this)->HasAuraType(SPELL_AURA_WATER_WALK) : false,
|
||||
GetCollisionHeight());
|
||||
}
|
||||
|
||||
float WorldObject::GetMapHeight(float x, float y, float z, bool vmap/* = true*/, float distanceToSearch/* = DEFAULT_HEIGHT_SEARCH*/) const
|
||||
|
||||
Reference in new issue
Block a user