mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-25 03:12:09 +01:00
Core/ObjectMgr: Refactor guild related functions into dedicated class
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user