From ad12cd7531d39dfab507e6ab21787f9148581ef4 Mon Sep 17 00:00:00 2001 From: DiSlord Date: Sat, 25 Apr 2009 10:41:23 +0400 Subject: [PATCH] [7713] Fix AreaGroup.dbc structure, more correct check it Signed-off-by: DiSlord --- src/game/DBCStructure.h | 3 ++- src/game/SpellMgr.cpp | 11 +++++++---- src/shared/revision_nr.h | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index af0e479cd..3cd5b79f6 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -509,7 +509,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 0b4647d98..edd592c8b 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2588,15 +2588,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; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 7a99d873a..cc87beb3c 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7712" + #define REVISION_NR "7713" #endif // __REVISION_NR_H__