fix(core): Null check the helpers (#11476)

* fix (core): move helper

* Update Spell.cpp

* Update Unit.cpp
This commit is contained in:
acidmanifesto
2022-04-22 09:11:06 -04:00
committed by GitHub
parent f137230974
commit f2de895921
2 changed files with 6 additions and 2 deletions

View File

@@ -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).