mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 01:37:05 +00:00
[10727] Map system re-engineered. Special thanks to Blueboy for tests.
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
f5e40a5fda
commit
f67d89f109
43 changed files with 1254 additions and 1128 deletions
|
|
@ -4243,11 +4243,11 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
VMAP::VMapFactory::createOrGetVMapManager()->isLineOfSightCalcEnabled())
|
||||
{
|
||||
if (m_spellInfo->Attributes & SPELL_ATTR_OUTDOORS_ONLY &&
|
||||
!m_caster->GetMap()->IsOutdoors(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ()))
|
||||
!m_caster->GetTerrain()->IsOutdoors(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ()))
|
||||
return SPELL_FAILED_ONLY_OUTDOORS;
|
||||
|
||||
if(m_spellInfo->Attributes & SPELL_ATTR_INDOORS_ONLY &&
|
||||
m_caster->GetMap()->IsOutdoors(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ()))
|
||||
m_caster->GetTerrain()->IsOutdoors(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ()))
|
||||
return SPELL_FAILED_ONLY_INDOORS;
|
||||
}
|
||||
// only check at first call, Stealth auras are already removed at second call
|
||||
|
|
@ -5130,7 +5130,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 = m_caster->GetBaseMap()->GetHeight(fx, fy, m_caster->GetPositionZ(), true);
|
||||
float fz = m_caster->GetTerrain()->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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue