aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/DBCStores.cpp23
-rw-r--r--src/game/DBCStores.h2
2 files changed, 19 insertions, 6 deletions
diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp
index a6b647b2ea8..5dae4cb6e17 100644
--- a/src/game/DBCStores.cpp
+++ b/src/game/DBCStores.cpp
@@ -522,12 +522,25 @@ void LoadDBCStores(const std::string& dataPath)
sLog.outString( ">> Initialized %d data stores", DBCFilesCount );
}
-SimpleFactionsList const* GetFactionTeamList(uint32 faction)
+SimpleFactionsList const* GetFactionTeamList(uint32 faction, bool &isTeamMember)
{
- FactionTeamMap::const_iterator itr = sFactionTeamMap.find(faction);
- if(itr==sFactionTeamMap.end())
- return NULL;
- return &itr->second;
+ for(FactionTeamMap::const_iterator itr = sFactionTeamMap.begin(); itr != sFactionTeamMap.end(); ++itr)
+ {
+ if(itr->first == faction)
+ {
+ isTeamMember = false;
+ return &itr->second;
+ }
+ for(SimpleFactionsList::const_iterator itr2 = itr->second.begin(); itr2 != itr->second.end(); ++itr2)
+ {
+ if((*itr2) == faction)
+ {
+ isTeamMember = true;
+ return &itr->second;
+ }
+ }
+ }
+ return NULL;
}
char* GetPetName(uint32 petfamily, uint32 dbclang)
diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h
index fc47568e6a5..4fd5b6bcb59 100644
--- a/src/game/DBCStores.h
+++ b/src/game/DBCStores.h
@@ -27,7 +27,7 @@
typedef std::list<uint32> SimpleFactionsList;
-SimpleFactionsList const* GetFactionTeamList(uint32 faction);
+SimpleFactionsList const* GetFactionTeamList(uint32 faction, bool &isTeamMember);
char* GetPetName(uint32 petfamily, uint32 dbclang);
uint32 GetTalentSpellCost(uint32 spellId);
TalentSpellPos const* GetTalentSpellPos(uint32 spellId);