mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +00:00
fix(Core): Fixed a few crashes/bugs that were found via static code analysis (#2617)
This commit is contained in:
@@ -395,11 +395,12 @@ public:
|
||||
}
|
||||
|
||||
// ensure LMK2 is at proper position
|
||||
if (Creature* LMK2 = GetLMK2())
|
||||
{
|
||||
LMK2->UpdatePosition(LMK2->GetHomePosition(), true);
|
||||
LMK2->StopMovingOnCurrentPos();
|
||||
}
|
||||
if (pInstance)
|
||||
if (Creature* LMK2 = GetLMK2())
|
||||
{
|
||||
LMK2->UpdatePosition(LMK2->GetHomePosition(), true);
|
||||
LMK2->StopMovingOnCurrentPos();
|
||||
}
|
||||
|
||||
if (pInstance && pInstance->GetData(TYPE_MIMIRON) != DONE)
|
||||
pInstance->SetData(TYPE_MIMIRON, IN_PROGRESS);
|
||||
|
||||
@@ -2312,8 +2312,14 @@ class spell_yogg_saron_brain_link : public SpellScriptLoader
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Unit* owner = GetUnitOwner();
|
||||
if (!owner)
|
||||
{
|
||||
SetDuration(0);
|
||||
return;
|
||||
}
|
||||
|
||||
Unit* _target = ObjectAccessor::GetUnit(*owner, _targetGUID);
|
||||
if (!owner || !_target || !_target->IsAlive() || fabs(owner->GetPositionZ() - _target->GetPositionZ()) > 10.0f) // Target or owner underground
|
||||
if (!_target || !_target->IsAlive() || fabs(owner->GetPositionZ() - _target->GetPositionZ()) > 10.0f) // Target or owner underground
|
||||
{
|
||||
SetDuration(0);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user