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

@@ -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: