fix(core): Null check the helpers (#11476)
* fix (core): move helper * Update Spell.cpp * Update Unit.cpp
This commit is contained in:
parent
f137230974
commit
f2de895921
2 changed files with 6 additions and 2 deletions
|
|
@ -19154,7 +19154,10 @@ void Unit::ExitVehicle(Position const* /*exitPosition*/)
|
|||
return;
|
||||
|
||||
GetVehicleBase()->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, GetGUID());
|
||||
ToPlayer()->SetCanTeleport(true);
|
||||
if (Player* player = ToPlayer())
|
||||
{
|
||||
player->SetCanTeleport(true);
|
||||
}
|
||||
//! The following call would not even be executed successfully as the
|
||||
//! SPELL_AURA_CONTROL_VEHICLE unapply handler already calls _ExitVehicle without
|
||||
//! specifying an exitposition. The subsequent call below would return on if (!m_vehicle).
|
||||
|
|
|
|||
|
|
@ -6036,7 +6036,8 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
if (m_pathFinder->GetPathType() & (PATHFIND_NOPATH | PATHFIND_INCOMPLETE) || target->GetExactDistSq(endPos.x, endPos.y, endPos.z) > maxdist * maxdist || m_pathFinder->getPathLength() > (40.0f + (m_caster->HasAura(58097) ? 5.0f : 0.0f)))
|
||||
return SPELL_FAILED_NOPATH;
|
||||
}
|
||||
m_caster->ToPlayer()->SetCanTeleport(true);
|
||||
if (Player* player = m_caster->ToPlayer())
|
||||
player->SetCanTeleport(true);
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_SKINNING:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue