mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
Various: Fix coverity reported issues.
This commit is contained in:
@@ -1642,6 +1642,8 @@ bool ScriptMgr::CanSpawn(ObjectGuid::LowType spawnId, uint32 entry, CreatureTemp
|
||||
ASSERT(actTemplate);
|
||||
|
||||
CreatureTemplate const* baseTemplate = sObjectMgr->GetCreatureTemplate(entry);
|
||||
if (!baseTemplate)
|
||||
baseTemplate = actTemplate;
|
||||
GET_SCRIPT_RET(CreatureScript, baseTemplate->ScriptID, tmpscript, true);
|
||||
return tmpscript->CanSpawn(spawnId, entry, baseTemplate, actTemplate, cData, map);
|
||||
}
|
||||
|
||||
@@ -829,9 +829,6 @@ class npc_toc_druid : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -925,9 +922,6 @@ class npc_toc_shaman : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1032,9 +1026,6 @@ class npc_toc_paladin : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1120,9 +1111,6 @@ class npc_toc_priest : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1220,9 +1208,6 @@ class npc_toc_shadow_priest : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
DoSpellAttackIfReady(SPELL_MIND_FLAY);
|
||||
}
|
||||
@@ -1314,9 +1299,6 @@ class npc_toc_warlock : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
DoSpellAttackIfReady(SPELL_SHADOW_BOLT);
|
||||
}
|
||||
@@ -1411,9 +1393,6 @@ class npc_toc_mage : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
DoSpellAttackIfReady(SPELL_FROSTBOLT);
|
||||
}
|
||||
@@ -1516,9 +1495,6 @@ class npc_toc_hunter : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
DoSpellAttackIfReady(SPELL_SHOOT);
|
||||
}
|
||||
@@ -1611,9 +1587,6 @@ class npc_toc_boomkin : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
DoSpellAttackIfReady(SPELL_WRATH);
|
||||
}
|
||||
@@ -1719,9 +1692,6 @@ class npc_toc_warrior : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1818,9 +1788,6 @@ class npc_toc_dk : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1926,9 +1893,6 @@ class npc_toc_rogue : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -2060,9 +2024,6 @@ class npc_toc_enh_shaman : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
private:
|
||||
@@ -2172,9 +2133,6 @@ class npc_toc_retro_paladin : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -2227,9 +2185,6 @@ class npc_toc_pet_warlock : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -280,9 +280,6 @@ class boss_gormok : public CreatureScript
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -617,9 +614,6 @@ struct boss_jormungarAI : public BossAI
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
if (events.IsInPhase(PHASE_MOBILE))
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
@@ -580,7 +580,7 @@ static const float MINION_AGGRO_DISTANCE = 20.0f;
|
||||
struct npc_kelthuzad_minionAI : public ScriptedAI
|
||||
{
|
||||
public:
|
||||
npc_kelthuzad_minionAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()), _movementTimer(urandms(4,12)), _home(me->GetPosition()) { }
|
||||
npc_kelthuzad_minionAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()), pocketId(0), _movementTimer(urandms(4,12)), _home(me->GetPosition()) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -601,6 +601,9 @@ struct npc_kelthuzad_minionAI : public ScriptedAI
|
||||
DoZoneInCombat();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pocketId)
|
||||
return;
|
||||
|
||||
std::list<Creature*> others;
|
||||
me->GetCreatureListWithEntryInGrid(others, me->GetEntry(), 80.0f);
|
||||
|
||||
@@ -4203,8 +4203,10 @@ class spell_gen_pony_mount_check : public SpellScriptLoader
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
Player* owner = caster->GetOwner()->ToPlayer();
|
||||
if (!caster || !owner || !owner->HasAchieved(ACHIEV_PONY_UP))
|
||||
if (!owner || !owner->HasAchieved(ACHIEV_PONY_UP))
|
||||
return;
|
||||
|
||||
if (owner->IsMounted())
|
||||
|
||||
Reference in New Issue
Block a user