mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[6861] Add and use function for more fast way to get areflag by area id.
This commit is contained in:
parent
5f33f4abf4
commit
8dfbcf7ee6
3 changed files with 13 additions and 3 deletions
|
|
@ -495,13 +495,22 @@ uint32 GetTalentSpellCost(uint32 spellId)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id)
|
int32 GetAreaFlagByAreaID(uint32 area_id)
|
||||||
{
|
{
|
||||||
AreaFlagByAreaID::iterator i = sAreaFlagByAreaID.find(area_id);
|
AreaFlagByAreaID::iterator i = sAreaFlagByAreaID.find(area_id);
|
||||||
if(i == sAreaFlagByAreaID.end())
|
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 NULL;
|
||||||
|
|
||||||
return sAreaStore.LookupEntry(i->second);
|
return sAreaStore.LookupEntry(areaflag );
|
||||||
}
|
}
|
||||||
|
|
||||||
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id)
|
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id)
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ char* GetPetName(uint32 petfamily, uint32 dbclang);
|
||||||
uint32 GetTalentSpellCost(uint32 spellId);
|
uint32 GetTalentSpellCost(uint32 spellId);
|
||||||
TalentSpellPos const* GetTalentSpellPos(uint32 spellId);
|
TalentSpellPos const* GetTalentSpellPos(uint32 spellId);
|
||||||
|
|
||||||
|
int32 GetAreaFlagByAreaID(uint32 area_id); // -1 if not found
|
||||||
AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id);
|
AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id);
|
||||||
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id);
|
AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id);
|
||||||
uint32 GetAreaFlagByMapId(uint32 mapid);
|
uint32 GetAreaFlagByMapId(uint32 mapid);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6860"
|
#define REVISION_NR "6861"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue