aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/DBCStructure.h3
-rw-r--r--src/game/SpellMgr.cpp11
2 files changed, 9 insertions, 5 deletions
diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h
index 6f8082eee72..5b165501afe 100644
--- a/src/game/DBCStructure.h
+++ b/src/game/DBCStructure.h
@@ -512,7 +512,8 @@ struct AreaTableEntry
struct AreaGroupEntry
{
uint32 AreaGroupId; // 0
- uint32 AreaId[7]; // 1-7
+ uint32 AreaId[6]; // 1-6
+ uint32 nextGroup; // 7 index of next group
};
struct AreaTriggerEntry
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;
}