diff options
author | Machiavelli <none@none> | 2009-10-10 23:02:11 +0200 |
---|---|---|
committer | Machiavelli <none@none> | 2009-10-10 23:02:11 +0200 |
commit | 566472918bd658aa0a5352ca5cc462a3ca222d54 (patch) | |
tree | 910f5ebfaffe7f0ee14a6e211b114551e3ae537c | |
parent | 5fcf3b3d8919374a326da97b69edb95c2949a787 (diff) |
ReputationMgr changes part 2
--HG--
branch : trunk
-rw-r--r-- | src/game/DBCStores.cpp | 23 | ||||
-rw-r--r-- | src/game/DBCStores.h | 2 |
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); |