mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Misc: Fix static analysis issues
(cherry picked from commit 9b7c73a19d)
This commit is contained in:
@@ -391,8 +391,7 @@ public:
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
|
||||
if (Orb && target)
|
||||
|
||||
@@ -203,9 +203,7 @@ public:
|
||||
//Charge_Timer
|
||||
if (Charge_Timer <= diff)
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoCast(target, SPELL_CHARGE);
|
||||
//me->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true, 1);
|
||||
|
||||
@@ -121,10 +121,7 @@ public:
|
||||
//ChangeTarget_Timer
|
||||
if (Submerged && ChangeTarget_Timer <= diff)
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (target)
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
|
||||
|
||||
ChangeTarget_Timer = urand(10000, 20000);
|
||||
|
||||
@@ -554,9 +554,7 @@ public:
|
||||
//Blizzard_Timer
|
||||
if (Blizzard_Timer <= diff)
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true);
|
||||
if (target)
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true))
|
||||
DoCast(target, SPELL_BLIZZARD);
|
||||
Blizzard_Timer = 15000 + rand32() % 15000;
|
||||
} else Blizzard_Timer -= diff;
|
||||
|
||||
@@ -331,9 +331,7 @@ public:
|
||||
|
||||
if (!instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER).IsEmpty())
|
||||
{
|
||||
Unit* victim = nullptr;
|
||||
victim = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER));
|
||||
if (victim)
|
||||
if (Unit* victim = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER)))
|
||||
AddThreat(victim, 1);
|
||||
StartEvent();
|
||||
}
|
||||
@@ -584,9 +582,7 @@ public:
|
||||
//at this point he divides himself in two parts
|
||||
CastConsumingMadness();
|
||||
DespawnDemon();
|
||||
Creature* Copy = nullptr;
|
||||
Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000);
|
||||
if (Copy)
|
||||
if (Creature* Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000))
|
||||
{
|
||||
Demon = Copy->GetGUID();
|
||||
if (me->GetVictim())
|
||||
@@ -762,9 +758,7 @@ public:
|
||||
|
||||
if (!me->IsInCombat() && !instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER).IsEmpty())
|
||||
{
|
||||
Unit* victim = nullptr;
|
||||
victim = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER));
|
||||
if (victim)
|
||||
if (Unit* victim = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LEOTHERAS_EVENT_STARTER)))
|
||||
AttackStart(victim);
|
||||
}
|
||||
|
||||
@@ -782,10 +776,8 @@ public:
|
||||
|
||||
if (Mindblast_Timer <= diff)
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
|
||||
if (target)DoCast(target, SPELL_MINDBLAST);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_MINDBLAST);
|
||||
|
||||
Mindblast_Timer = urand(10000, 15000);
|
||||
} else Mindblast_Timer -= diff;
|
||||
|
||||
@@ -180,9 +180,7 @@ public:
|
||||
//Charging_Timer
|
||||
if (Charging_Timer <= diff)
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
AttackStart(target);
|
||||
DoCast(target, SPELL_BERSERKER_C);
|
||||
@@ -292,9 +290,7 @@ public:
|
||||
//DeathCoil Timer /need correct timer
|
||||
if (DeathCoil_Timer <= diff)
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_DEATH_COIL);
|
||||
DeathCoil_Timer = 20000;
|
||||
} else DeathCoil_Timer -= diff;
|
||||
|
||||
@@ -435,9 +435,7 @@ class boss_alar : public CreatureScript
|
||||
}
|
||||
else
|
||||
{
|
||||
Unit* target = nullptr;
|
||||
target = me->SelectNearestTargetInAttackDistance(5);
|
||||
if (target)
|
||||
if (Unit* target = me->SelectNearestTargetInAttackDistance(5))
|
||||
AttackStart(target);
|
||||
else
|
||||
{
|
||||
|
||||
@@ -172,7 +172,7 @@ void ByteBuffer::hexlike() const
|
||||
for (uint32 i = 0; i < size(); ++i)
|
||||
{
|
||||
char buf[4];
|
||||
snprintf(buf, 4, "%2X ", read<uint8>(i));
|
||||
snprintf(buf, 4, "%2X", read<uint8>(i));
|
||||
if ((i == (j * 8)) && ((i != (k * 16))))
|
||||
{
|
||||
o << "| ";
|
||||
|
||||
Reference in New Issue
Block a user