From 566472918bd658aa0a5352ca5cc462a3ca222d54 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 10 Oct 2009 23:02:11 +0200 Subject: ReputationMgr changes part 2 --HG-- branch : trunk --- src/game/DBCStores.cpp | 23 ++++++++++++++++++----- src/game/DBCStores.h | 2 +- 2 files changed, 19 insertions(+), 6 deletions(-) (limited to 'src') 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 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); -- cgit v1.2.3