Core/ObjectMgr: Refactor guild related functions into dedicated class

This commit is contained in:
leak
2011-05-04 10:08:09 +02:00
parent 6d63f92bdb
commit ea06dcf418
15 changed files with 507 additions and 430 deletions
+4 -3
View File
@@ -42,6 +42,7 @@
#include "CellImpl.h"
#include "ObjectMgr.h"
#include "ArenaTeamMgr.h"
#include "GuildMgr.h"
#include "ObjectAccessor.h"
#include "CreatureAI.h"
#include "Formulas.h"
@@ -4726,7 +4727,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
sObjectAccessor->ConvertCorpseForPlayer(playerguid);
if (uint32 guildId = GetGuildIdFromDB(playerguid))
if (Guild* pGuild = sObjectMgr->GetGuildById(guildId))
if (Guild* pGuild = sGuildMgr->GetGuildById(guildId))
pGuild->DeleteMember(guid);
// remove from arena teams
@@ -5409,7 +5410,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
return TotalCost;
}
Guild *pGuild = sObjectMgr->GetGuildById(GetGuildId());
Guild *pGuild = sGuildMgr->GetGuildById(GetGuildId());
if (!pGuild)
return TotalCost;
@@ -24346,7 +24347,7 @@ uint32 Player::GetReputation(uint32 factionentry)
std::string Player::GetGuildName()
{
return sObjectMgr->GetGuildById(GetGuildId())->GetName();
return sGuildMgr->GetGuildById(GetGuildId())->GetName();
}
void Player::SendDuelCountdown(uint32 counter)