Core/ObjectMgr: Refactor guild related functions into dedicated class
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user