[8026] Obtain object's map directly by calling appropriate WorldObject::GetMap()/GetBaseMap() functions instead of accessing MapManager. Code cleanups. Big thanks Infinity for tests.

Signed-off-by: AlexDereka <dereka.alex@gmail.com>
This commit is contained in:
Ambal 2009-06-16 12:20:11 +04:00 committed by AlexDereka
parent 1187c8698c
commit b76c4c2f3c
29 changed files with 99 additions and 99 deletions

View file

@ -4396,7 +4396,7 @@ SpellCastResult Spell::CheckCast(bool strict)
float fx = m_caster->GetPositionX() + dis * cos(m_caster->GetOrientation());
float fy = m_caster->GetPositionY() + dis * sin(m_caster->GetOrientation());
// teleport a bit above terrain level to avoid falling below it
float fz = MapManager::Instance().GetBaseMap(m_caster->GetMapId())->GetHeight(fx,fy,m_caster->GetPositionZ(),true);
float fz = m_caster->GetBaseMap()->GetHeight(fx,fy,m_caster->GetPositionZ(),true);
if(fz <= INVALID_HEIGHT) // note: this also will prevent use effect in instances without vmaps height enabled
return SPELL_FAILED_TRY_AGAIN;