Core/Misc: more warning fixes (some of them were real logical flaws - comparison of unrelated types) (Thanks to Tassader for pointing out that one line was completely unnecessary)

This commit is contained in:
Az@zel
2011-05-11 12:32:54 +06:00
parent 58f0a4b152
commit 52bc1e5fd3
6 changed files with 15 additions and 19 deletions

View File

@@ -1022,18 +1022,15 @@ public:
if (!instance)
return;
if (Unit::GetCreature(*me, instance->GetData64(DATA_MALYGOS)))
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
{
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
if (Creature* malygos = Unit::GetCreature(*me, instance->GetData64(DATA_MALYGOS)))
{
summoner->CastSpell(me, SPELL_RIDE_RED_DRAGON, true);
if (Creature* malygos = Unit::GetCreature(*me, instance->GetData64(DATA_MALYGOS)))
{
float victim_threat = malygos->getThreatManager().getThreat(summoner);
malygos->getThreatManager().resetAllAggro();
malygos->AI()->AttackStart(me);
malygos->AddThreat(me, victim_threat);
}
float victim_threat = malygos->getThreatManager().getThreat(summoner);
malygos->getThreatManager().resetAllAggro();
malygos->AI()->AttackStart(me);
malygos->AddThreat(me, victim_threat);
}
}
}

View File

@@ -745,14 +745,11 @@ class spell_shield_of_runes : public SpellScriptLoader
{
PrepareAuraScript(spell_shield_of_runes_AuraScript);
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes mode)
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster)
return;
if (mode != AURA_REMOVE_BY_EXPIRE)
caster->CastSpell(caster, SPELL_SHIELD_OF_RUNES_BUFF, false);
if (Unit* caster = GetCaster())
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
caster->CastSpell(caster, SPELL_SHIELD_OF_RUNES_BUFF, false);
}
void Register()

View File

@@ -489,6 +489,8 @@ class spell_ulduar_cancel_stone_grip : public SpellScriptLoader
case RAID_DIFFICULTY_25MAN_NORMAL:
target->RemoveAura(SpellMgr::CalculateSpellEffectAmount(GetSpellInfo(), EFFECT_1));
break;
default:
break;
}
}