Cleaning unused variables

This commit is contained in:
Yehonal 2017-09-19 11:23:07 +02:00
parent 787a9238df
commit 944cfd077e
23 changed files with 25 additions and 25 deletions

View file

@ -734,7 +734,7 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket* data, uint64 guid
*data << uint32(0); // number of bg instances
if (Battleground* bgt = GetBattlegroundTemplate(bgTypeId))
if (PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgt->GetMapId(), player->getLevel()))
if (GetBattlegroundBracketByLevel(bgt->GetMapId(), player->getLevel()))
{
uint32 count = 0;
/*for (BattlegroundClientIdsContainer::const_iterator itr = clientIds.begin(); itr != clientIds.end(); ++itr)

View file

@ -347,7 +347,7 @@ void GameObject::Update(uint32 diff)
// Bombs
if (goInfo->trap.type == 2)
m_cooldownTime = World::GetGameTimeMS()+10*IN_MILLISECONDS; // Hardcoded tooltip value
else if (Unit* owner = GetOwner())
else if (GetOwner())
m_cooldownTime = World::GetGameTimeMS()+goInfo->trap.startDelay*IN_MILLISECONDS;
m_lootState = GO_READY;

View file

@ -8835,7 +8835,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
if (!roll_chance_i(aurEff->GetAmount()))
{
// Xinef: dont allow normal proc to override set one
if (Aura* aura = GetAura((trigger_spell_id == 46916) ? 71072 : 71069))
if (GetAura((trigger_spell_id == 46916) ? 71072 : 71069))
return false;
// Xinef: just to be sure
RemoveAurasDueToSpell(70849);

View file

@ -1927,7 +1927,7 @@ void WorldSession::HandleHearthAndResurrect(WorldPacket& /*recv_data*/)
if (_player->IsInFlight())
return;
if(Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
if(/*Battlefield* bf = */sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
{
// bf->PlayerAskToLeave(_player); FIXME
return;

View file

@ -1362,7 +1362,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
if (GetSpellInfo()->SpellFamilyFlags[0] & 0x10 && GetEffect(0))
{
// Druid T8 Restoration 4P Bonus
if (AuraEffect const * aurEff = caster->GetAuraEffectDummy(64760))
if (caster->GetAuraEffectDummy(64760))
{
uint32 damage = GetEffect(0)->GetAmount();
damage = target->SpellHealingBonusTaken(caster, GetSpellInfo(), damage, DOT);

View file

@ -3948,7 +3948,7 @@ void Spell::_handle_finish_phase()
m_caster->HandleProcExtraAttackFor(m_caster->GetVictim());
if (!IsAutoRepeat() && !IsNextMeleeSwingSpell())
if (Player* p = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself())
if (m_caster->GetCharmerOrOwnerPlayerOrPlayerItself())
for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
{
// Xinef: Properly clear infinite cooldowns in some cases

View file

@ -640,7 +640,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
{
uint8 level = m_caster->getLevel();
uint32 block_value = m_caster->GetShieldBlockValue(uint32(float(level) * 29.5f), uint32(float(level) * 34.5f));
if (AuraEffect *aurEff = m_caster->GetAuraEffect(64882, EFFECT_0))
if (m_caster->GetAuraEffect(64882, EFFECT_0))
block_value += 225;
damage += CalculatePct(block_value, m_spellInfo->Effects[EFFECT_1].CalcValue());
break;

View file

@ -445,7 +445,7 @@ public:
if (status)
handler->PSendSysMessage(LANG_LIQUID_STATUS, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status);
if (Transport* t = object->GetTransport())
if (object->GetTransport())
handler->PSendSysMessage("Transport offset: %.2f, %.2f, %.2f, %.2f", object->m_movementInfo.transport.pos.GetPositionX(), object->m_movementInfo.transport.pos.GetPositionY(), object->m_movementInfo.transport.pos.GetPositionZ(), object->m_movementInfo.transport.pos.GetOrientation());
return true;

View file

@ -165,7 +165,7 @@ public:
// pussywizard:
bool reset = true;
if (instance)
if (Creature* nefarian = instance->instance->GetCreature(instance->GetData64(DATA_NEFARIAN)))
if (/*Creature* nefarian = */instance->instance->GetCreature(instance->GetData64(DATA_NEFARIAN)))
reset = false;
if (reset)
_Reset();

View file

@ -323,7 +323,7 @@ public:
spawnPos.m_positionX += 5.0f*cos(4.5f);
spawnPos.m_positionY += 5.0f*sin(4.5f);
for (uint8 i=0; i<5; ++i)
if (Creature* s = me->SummonCreature(NPC_SCOURGE_ZOMBIE, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
if (me->SummonCreature(NPC_SCOURGE_ZOMBIE, spawnPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
{
spawnPos.m_positionX += 2.5f*cos(4.5f);
spawnPos.m_positionY += 2.5f*sin(4.5f);

View file

@ -1186,7 +1186,7 @@ public:
}
// Check if exhausted
if (Aura* exh = caster->GetAura(SPELL_RAM_EXHAUSTED))
if (caster->GetAura(SPELL_RAM_EXHAUSTED))
{
if (privateLevel)
{
@ -1397,7 +1397,7 @@ public:
SpellCastResult CheckTarget()
{
if (Unit* caster = GetCaster())
if (Player* pCaster = caster->ToPlayer())
if (caster->ToPlayer())
if (Unit* target = caster->ToPlayer()->GetSelectedUnit())
if (target->GetEntry() == 23487 && target->IsAlive())
return SPELL_CAST_OK;

View file

@ -281,7 +281,7 @@ public:
Events.ScheduleEvent(EVENT_SUMMON_KEEPER, 6000);
Events.SetPhase(0);
if (Creature* medivh = instance->GetCreature(_medivhGUID))
if (instance->GetCreature(_medivhGUID))
{
uint8 position = (_currentRift-1)%4;
instance->SummonCreature(NPC_TIME_RIFT, PortalLocation[position]);

View file

@ -1080,7 +1080,7 @@ class spell_halion_clear_debuffs : public SpellScriptLoader
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
if (GetHitUnit())
{
GetHitUnit()->RemoveAurasDueToSpell(GetSpellInfo()->Effects[EFFECT_0].CalcValue());
GetHitUnit()->RemoveAurasDueToSpell(GetSpellInfo()->Effects[EFFECT_1].CalcValue());

View file

@ -1810,7 +1810,7 @@ public:
events.RepeatEvent(5000);
break;
case EVENT_SPELL_STRANGULATE:
if( Unit* target = SelectEnemyCaster(false, 30.0f) )
if(SelectEnemyCaster(false, 30.0f))
{
me->CastSpell(me->GetVictim(), SPELL_STRANGULATE, false);
events.RepeatEvent(120000);

View file

@ -1871,7 +1871,7 @@ public:
events.ScheduleEvent(2, 4500);
break;
case 3:
if (Unit* target = SelectTargetFromPlayerList(30.0f, 0, true))
if (SelectTargetFromPlayerList(30.0f, 0, true))
me->CastSpell(me->GetVictim(), 70145, false);
events.ScheduleEvent(3, 9000);
break;

View file

@ -571,7 +571,7 @@ class boss_lady_deathwhisper : public CreatureScript
// helper for summoning wave mobs
void Summon(uint32 entry, const Position& pos)
{
if (TempSummon* summon = me->SummonCreature(entry, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000))
if (me->SummonCreature(entry, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000))
if (TempSummon* trigger = me->SummonCreature(WORLD_TRIGGER, pos, TEMPSUMMON_TIMED_DESPAWN, 2000))
{
trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);

View file

@ -150,7 +150,7 @@ public:
if (GameObject* go = instance->GetGameObject(GO_ExitPortalGUID))
go->SetPhaseMask(1, true);
if (Creature* c = instance->GetCreature(NPC_MalygosGUID))
if (Creature* alexstrasza = c->SummonCreature(NPC_ALEXSTRASZA, 798.0f, 1268.0f, 299.0f, 2.45f ,TEMPSUMMON_TIMED_DESPAWN, 604800000))
if (c->SummonCreature(NPC_ALEXSTRASZA, 798.0f, 1268.0f, 299.0f, 2.45f ,TEMPSUMMON_TIMED_DESPAWN, 604800000))
break;
}
if (data == DONE)

View file

@ -455,7 +455,7 @@ public:
}
case EVENT_ABEDNEUM_HEAD: // Third
{
if (Creature *abedneum = GetAbedneum())
if (GetAbedneum())
{
Player *plr = SelectTargetFromPlayerList(100.0f);
if (!plr)

View file

@ -550,7 +550,7 @@ public:
events.ScheduleEvent(EVENT_ELEVATOR_INTERVAL_1, 6000);
break;
case EVENT_ELEVATOR_INTERVAL_1:
if( Creature* VX001 = me->SummonCreature(NPC_VX001, 2744.65f, 2569.46f, 364.40f, 3.14f, TEMPSUMMON_MANUAL_DESPAWN) )
if(me->SummonCreature(NPC_VX001, 2744.65f, 2569.46f, 364.40f, 3.14f, TEMPSUMMON_MANUAL_DESPAWN))
{
if( GameObject *elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 100.0f) )
{

View file

@ -413,7 +413,7 @@ class boss_high_nethermancer_zerevor : public CreatureScript
events.ScheduleEvent(EVENT_SPELL_BLIZZARD, 40000);
break;
case EVENT_SPELL_ARCANE_EXPLOSION:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f))
if (SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f))
me->CastSpell(me, SPELL_ARCANE_EXPLOSION, false);
events.ScheduleEvent(EVENT_SPELL_ARCANE_EXPLOSION, 10000);
break;

View file

@ -324,7 +324,7 @@ public:
return true;
if (!pPlayer->HasItemCount(ITEM_MAGMA_TOTEM))
return true;
if (Creature* c = pGO->FindNearestCreature(NPC_AHUNE, 200.0f, true))
if (pGO->FindNearestCreature(NPC_AHUNE, 200.0f, true))
return true;
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Disturb the stone and summon Lord Ahune.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1337);
@ -340,7 +340,7 @@ public:
return true;
if (!pPlayer->HasItemCount(ITEM_MAGMA_TOTEM))
return true;
if (Creature* c = pGO->FindNearestCreature(NPC_AHUNE, 200.0f, true))
if (pGO->FindNearestCreature(NPC_AHUNE, 200.0f, true))
return true;
if (Creature* c = pGO->SummonCreature(NPC_AHUNE, AhuneSummonPos, TEMPSUMMON_MANUAL_DESPAWN))

View file

@ -937,7 +937,7 @@ class spell_dk_pet_scaling : public SpellScriptLoader
int32 modifier = 33;
// xinef: impurity
if (AuraEffect const* impurityEff = owner->GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 1986, 0))
if (owner->GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 1986, 0))
modifier = 40;
amount = CalculatePct(std::max<int32>(0, owner->GetTotalAttackPowerValue(BASE_ATTACK)), modifier);

View file

@ -624,7 +624,7 @@ class spell_dru_lifebloom : public SpellScriptLoader
{
if (Unit* target = GetUnitOwner())
{
if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
if (GetEffect(EFFECT_1))
{
Unit* caster = GetCaster();
int32 healAmount = GetSpellInfo()->Effects[EFFECT_1].CalcValue(caster ? caster : target, 0, target) * dispelInfo->GetRemovedCharges();