[7713] Fix AreaGroup.dbc structure, more correct check it

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
DiSlord 2009-04-25 10:41:23 +04:00
parent 727f590f6e
commit ad12cd7531
3 changed files with 10 additions and 6 deletions

View file

@ -509,7 +509,8 @@ struct AreaTableEntry
struct AreaGroupEntry struct AreaGroupEntry
{ {
uint32 AreaGroupId; // 0 uint32 AreaGroupId; // 0
uint32 AreaId[7]; // 1-7 uint32 AreaId[6]; // 1-6
uint32 nextGroup; // 7 index of next group
}; };
struct AreaTriggerEntry struct AreaTriggerEntry

View file

@ -2588,15 +2588,18 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell
if( spellInfo->AreaGroupId > 0) if( spellInfo->AreaGroupId > 0)
{ {
bool found = false; bool found = false;
AreaGroupEntry const* groupEntry = sAreaGroupStore.LookupEntry(spellInfo->AreaGroupId); 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 ) if( groupEntry->AreaId[i] == zone_id || groupEntry->AreaId[i] == area_id )
found = true; found = true;
if (found || !groupEntry->nextGroup)
break;
// Try search in next group
groupEntry = sAreaGroupStore.LookupEntry(groupEntry->nextGroup);
} }
if(!found) if(!found)
return SPELL_FAILED_INCORRECT_AREA; return SPELL_FAILED_INCORRECT_AREA;
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7712" #define REVISION_NR "7713"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__