Misc: fixed issues discovered by static analysis

closes #290
This commit is contained in:
Ovahlord committed 2021-09-10 09:56:49 +02:00
1 parent 60c68dacca
commit c2be4c4a86
3 files changed
+2 -3

No files matched your search

@@ -1264,7 +1264,6 @@ class spell_omnotron_activated : public AuraScript
{
PreventDefaultAction();
if (Unit* caster = GetCaster())
if (caster->GetVictim())
if (caster->GetVictim())
caster->CastSpell(GetCaster()->GetVictim(), GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST));
}
@@ -1212,7 +1212,7 @@ struct npc_argent_captainAI : public ScriptedAI
{
me->GetMotionMaster()->Clear(false);
if (Creature* crok = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_CROK_SCOURGEBANE)))
me->GetMotionMaster()->MoveFollow(crok, FollowDist, FollowAngle, MOTION_SLOT_IDLE);
me->GetMotionMaster()->MoveFollow(crok, FollowDist, FollowAngle, true, true);
}
Reset();
@@ -1738,7 +1738,7 @@ class spell_vehicle_throw_passenger : public SpellScriptLoader
void HandleScript(SpellEffIndex effIndex)
{
Spell* baseSpell = GetSpell();
SpellCastTargets targets = baseSpell->m_targets;
SpellCastTargets const& targets = baseSpell->m_targets;
int32 damage = GetEffectValue();
if (targets.HasTraj())
if (Vehicle* vehicle = GetCaster()->GetVehicleKit())