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

@@ -145,7 +145,7 @@ public:
class GlyphChatLink : public SpellChatLink
{
public:
GlyphChatLink() : SpellChatLink(), _glyph(NULL), _slotId(0) { }
GlyphChatLink() : SpellChatLink(), _slotId(0), _glyph(NULL) { }
virtual bool Initialize(std::istringstream& iss);
private:
uint32 _slotId;

View File

@@ -204,7 +204,7 @@ bool SpellScript::UnitTargetHandler::CheckEffect(SpellEntry const* spellEntry, u
{
if (!targetType)
return false;
return (effIndex == SPELL_EFFECT_ANY) || (spellEntry->EffectImplicitTargetA[effIndex] == targetType || spellEntry->EffectImplicitTargetB[effIndex] == targetType);
return (effIndex == EFFECT_ALL) || (spellEntry->EffectImplicitTargetA[effIndex] == targetType || spellEntry->EffectImplicitTargetB[effIndex] == targetType);
}
void SpellScript::UnitTargetHandler::Call(SpellScript* spellScript, std::list<Unit*>& unitTargets)

View File

@@ -196,7 +196,7 @@ void GmTicket::TeleportTo(Player* player) const
///////////////////////////////////////////////////////////////////////////////////////////////////
// Ticket manager
TicketMgr::TicketMgr() : _lastTicketId(0), _lastSurveyId(0), _openTicketCount(0), _lastChange(time(NULL)), _status(true) { }
TicketMgr::TicketMgr() : _status(true), _lastTicketId(0), _lastSurveyId(0), _openTicketCount(0), _lastChange(time(NULL)) { }
void TicketMgr::Initialize() { SetStatus(sWorld->getBoolConfig(CONFIG_ALLOW_TICKETS)); }

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;
}
}