[6861] Add and use function for more fast way to get areflag by area id.

This commit is contained in:
VladimirMangos 2008-11-30 05:17:34 +03:00
parent 5f33f4abf4
commit 8dfbcf7ee6
3 changed files with 13 additions and 3 deletions

View file

@ -495,13 +495,22 @@ uint32 GetTalentSpellCost(uint32 spellId)
return 0;
}
AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id)
int32 GetAreaFlagByAreaID(uint32 area_id)
{
AreaFlagByAreaID::iterator i = sAreaFlagByAreaID.find(area_id);
if(i == sAreaFlagByAreaID.end())
return -1;
return i->second;
}
AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id)
{
int32 areaflag = GetAreaFlagByAreaID(area_id);
if(areaflag < 0)
return NULL;
return sAreaStore.LookupEntry(i->second);
return sAreaStore.LookupEntry(areaflag );
}
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id)

View file

@ -33,6 +33,7 @@ char* GetPetName(uint32 petfamily, uint32 dbclang);
uint32 GetTalentSpellCost(uint32 spellId);
TalentSpellPos const* GetTalentSpellPos(uint32 spellId);
int32 GetAreaFlagByAreaID(uint32 area_id); // -1 if not found
AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id);
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id);
uint32 GetAreaFlagByMapId(uint32 mapid);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "6860"
#define REVISION_NR "6861"
#endif // __REVISION_NR_H__