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

View File

@@ -18,6 +18,7 @@
#include "DatabaseEnv.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "ScriptMgr.h"
#include "Chat.h"
#include "Config.h"
@@ -1092,14 +1093,14 @@ Guild::~Guild()
bool Guild::Create(Player* pLeader, const std::string& name)
{
// Check if guild with such name already exists
if (sObjectMgr->GetGuildByName(name))
if (sGuildMgr->GetGuildByName(name))
return false;
WorldSession* pLeaderSession = pLeader->GetSession();
if (!pLeaderSession)
return false;
m_id = sObjectMgr->GenerateGuildId();
m_id = sGuildMgr->GenerateGuildId();
m_leaderGuid = pLeader->GetGUID();
m_name = name;
m_info = "";
@@ -1194,7 +1195,7 @@ void Guild::Disband()
trans->Append(stmt);
CharacterDatabase.CommitTransaction(trans);
sObjectMgr->RemoveGuild(m_id);
sGuildMgr->RemoveGuild(m_id);
}
///////////////////////////////////////////////////////////////////////////////