fix(Core): Fixed a few crashes/bugs that were found via static code analysis (#2617)

This commit is contained in:
Kaev
2020-01-25 14:26:38 +01:00
committed by Stoabrogga
parent 1bbe10dc33
commit 999d588c37
21 changed files with 80 additions and 59 deletions

View File

@@ -876,7 +876,8 @@ public:
despawnTimer = 0;
me->UpdatePosition(CenterPos.GetPositionX(), CenterPos.GetPositionY(), CenterPos.GetPositionZ()+18.0f, 0.0f, true);
me->StopMovingOnCurrentPos();
me->GetVehicleKit()->RemoveAllPassengers();
if (Vehicle* vehicle = me->GetVehicleKit())
vehicle->RemoveAllPassengers();
me->DespawnOrUnsummon();
return;
}

View File

@@ -778,9 +778,12 @@ class spell_oculus_rider_aura : public SpellScriptLoader
void HandleOnEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
Creature* drake = caster->GetVehicleCreatureBase();
if (!drake || !caster)
if (!drake)
return;
switch (aurEff->GetEffIndex())