[12027] Add some VMap LoS checking functions to Map scope

This commit is contained in:
Reamer 2012-07-05 19:37:25 +02:00 committed by Schmoozerd
parent 0e0a765312
commit ea30899db4
6 changed files with 28 additions and 19 deletions

View file

@ -8777,10 +8777,10 @@ void Spell::EffectBlock(SpellEffectIndex /*eff_idx*/)
void Spell::EffectLeapForward(SpellEffectIndex eff_idx)
{
if(unitTarget->IsTaxiFlying())
if (unitTarget->IsTaxiFlying())
return;
if( m_spellInfo->rangeIndex == 1) //self range
if (m_spellInfo->rangeIndex == 1) // self range
{
float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[eff_idx]));
@ -8790,14 +8790,8 @@ void Spell::EffectLeapForward(SpellEffectIndex eff_idx)
float ox, oy, oz;
unitTarget->GetPosition(ox, oy, oz);
float fx2, fy2, fz2; // getObjectHitPos overwrite last args in any result case
if(VMAP::VMapFactory::createOrGetVMapManager()->getObjectHitPos(unitTarget->GetMapId(), ox,oy,oz+0.5f, fx,fy,oz+0.5f,fx2,fy2,fz2, -0.5f))
{
fx = fx2;
fy = fy2;
fz = fz2;
if (unitTarget->GetMap()->GetObjectHitPos(ox,oy,oz+0.5f, fx,fy,oz+0.5f,fx,fy,fz, -0.5f))
unitTarget->UpdateAllowedPositionZ(fx, fy, fz);
}
unitTarget->NearTeleportTo(fx, fy, fz, unitTarget->GetOrientation(), unitTarget == m_caster);
}