Core/Misc: Refactor scripts to fix static analysis warnings

First batch of fixes targeting 100 issues reported by Coverity
This commit is contained in:
jackpoz
2014-08-31 20:12:47 +02:00
parent 681cf8f27c
commit dd4dbdcd16
45 changed files with 1150 additions and 450 deletions
+30 -6
View File
@@ -54,14 +54,22 @@ public:
struct guard_genericAI : public GuardAI
{
guard_genericAI(Creature* creature) : GuardAI(creature) { }
guard_genericAI(Creature* creature) : GuardAI(creature)
{
Initialize();
}
void Reset() override
void Initialize()
{
globalCooldown = 0;
buffTimer = 0;
}
void Reset() override
{
Initialize();
}
void EnterCombat(Unit* who) override
{
if (me->GetEntry() == NPC_CENARION_HOLD_INFANTRY)
@@ -263,9 +271,12 @@ public:
struct guard_shattrath_scryerAI : public GuardAI
{
guard_shattrath_scryerAI(Creature* creature) : GuardAI(creature) { }
guard_shattrath_scryerAI(Creature* creature) : GuardAI(creature)
{
Initialize();
}
void Reset() override
void Initialize()
{
banishTimer = 5000;
exileTimer = 8500;
@@ -273,6 +284,11 @@ public:
canTeleport = false;
}
void Reset() override
{
Initialize();
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
@@ -328,9 +344,12 @@ public:
struct guard_shattrath_aldorAI : public GuardAI
{
guard_shattrath_aldorAI(Creature* creature) : GuardAI(creature) { }
guard_shattrath_aldorAI(Creature* creature) : GuardAI(creature)
{
Initialize();
}
void Reset() override
void Initialize()
{
banishTimer = 5000;
exileTimer = 8500;
@@ -338,6 +357,11 @@ public:
canTeleport = false;
}
void Reset() override
{
Initialize();
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())