From 452cada8b63e3a894fe75e1700c56e5ce3a79301 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 19 Apr 2010 17:04:28 +0200 Subject: ScriptedAI: Fix types in SelectSpell --HG-- branch : trunk --- src/game/ScriptedCreature.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/game/ScriptedCreature.cpp') diff --git a/src/game/ScriptedCreature.cpp b/src/game/ScriptedCreature.cpp index 1a2060f330c..8c4ddd14f07 100644 --- a/src/game/ScriptedCreature.cpp +++ b/src/game/ScriptedCreature.cpp @@ -197,7 +197,7 @@ Unit* ScriptedAI::SelectUnit(SelectAggroTarget pTarget, uint32 uiPosition) } } -SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, int32 uiSchool, int32 uiMechanic, SelectTargetType selectTargets, uint32 uiPowerCostMin, uint32 uiPowerCostMax, float fRangeMin, float fRangeMax, SelectEffect selectEffects) +SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, uint32 uiSchool, uint32 uiMechanic, SelectTargetType selectTargets, uint32 uiPowerCostMin, uint32 uiPowerCostMax, float fRangeMin, float fRangeMax, SelectEffect selectEffects) { //No target so we can't cast if (!pTarget) @@ -235,11 +235,11 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, int32 uiSchool, int32 u continue; //Check for school if specified - if (uiSchool >= 0 && pTempSpell->SchoolMask & uiSchool) + if (uiSchool && (pTempSpell->SchoolMask & uiSchool) == 0) continue; //Check for spell mechanic if specified - if (uiMechanic >= 0 && pTempSpell->Mechanic != uiMechanic) + if (uiMechanic && pTempSpell->Mechanic != uiMechanic) continue; //Make sure that the spell uses the requested amount of power -- cgit v1.2.3