Core/Maps: Adjusted WorldObject::GetGridActivationRange() to never be less than map visibility distance for active objects to ensure equal ranges for activation/deactivation of grids

Updates #19072
This commit is contained in:
Shauren authored and Aokromes committed 2017-02-10 05:26:38 +01:00
1 parent 159709e0b0
commit 9d4a1ddc10
2 files changed
+11 -21

No files matched your search

+9 -14
View File
@@ -1692,23 +1692,18 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const
float WorldObject::GetGridActivationRange() const
{
if (ToPlayer())
if (isActiveObject())
{
if (ToPlayer()->GetCinematicMgr()->IsOnCinematic())
return DEFAULT_VISIBILITY_INSTANCE;
if (GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetCinematicMgr->IsOnCinematic())
return std::max(DEFAULT_VISIBILITY_INSTANCE, GetMap()->GetVisibilityRange());
return GetMap()->GetVisibilityRange();
}
else if (ToCreature())
return ToCreature()->m_SightDistance;
else if (ToDynObject())
{
if (isActiveObject())
return GetMap()->GetVisibilityRange();
else
return 0.0f;
}
else
return 0.0f;
if (Creature const* thisCreature = ToCreature())
return thisCreature->m_SightDistance;
return 0.0f;
}
float WorldObject::GetVisibilityRange() const