mirror of
https://github.com/mangosfour/server.git
synced 2025-12-28 22:37:04 +00:00
[12027] Add some VMap LoS checking functions to Map scope
This commit is contained in:
parent
0e0a765312
commit
ea30899db4
6 changed files with 28 additions and 19 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue