aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellMgr.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-25 09:06:43 -0500
committermegamage <none@none>2009-04-25 09:06:43 -0500
commitc4e6f9708fa07baa3ae9f4689e41c5ed98cb05d7 (patch)
tree8b2bb42b2220228a1a266945510f90effe9e8cb3 /src/game/SpellMgr.cpp
parent7901962074121e898699a1c280b51136c0a12c25 (diff)
[7713] Fix AreaGroup.dbc structure, more correct check it Author: DiSlord
--HG-- branch : trunk
Diffstat (limited to 'src/game/SpellMgr.cpp')
-rw-r--r--src/game/SpellMgr.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 53b72f7297f..0bd5832d354 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -2845,15 +2845,18 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
if( spellInfo->AreaGroupId > 0)
{
bool found = false;
-
AreaGroupEntry const* groupEntry = sAreaGroupStore.LookupEntry(spellInfo->AreaGroupId);
- if(groupEntry)
+ while (groupEntry)
{
- for (uint8 i=0; i<7; i++)
+ for (uint32 i=0; i<6; i++)
if( groupEntry->AreaId[i] == zone_id || groupEntry->AreaId[i] == area_id )
found = true;
+ if (found || !groupEntry->nextGroup)
+ break;
+ // Try search in next group
+ groupEntry = sAreaGroupStore.LookupEntry(groupEntry->nextGroup);
}
-
+
if(!found)
return SPELL_FAILED_INCORRECT_AREA;
}