aboutsummaryrefslogtreecommitdiff
path: root/src/game/ScriptedCreature.cpp
diff options
context:
space:
mode:
authorSpp <none@none>2010-04-19 17:04:28 +0200
committerSpp <none@none>2010-04-19 17:04:28 +0200
commit452cada8b63e3a894fe75e1700c56e5ce3a79301 (patch)
treeeda4157cc1b3723d54ad05e58b4d4a32ed86701a /src/game/ScriptedCreature.cpp
parentbe01821050dd30ff65e89b347d528efb20aba028 (diff)
ScriptedAI: Fix types in SelectSpell
--HG-- branch : trunk
Diffstat (limited to 'src/game/ScriptedCreature.cpp')
-rw-r--r--src/game/ScriptedCreature.cpp6
1 files changed, 3 insertions, 3 deletions
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