Core/ObjectMgr: Refactor group related functions into dedicated class
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "ArenaTeamMgr.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "Formulas.h"
|
||||
@@ -4736,7 +4737,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
||||
// the player was uninvited already on logout so just remove from group
|
||||
QueryResult resultGroup = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", guid);
|
||||
if (resultGroup)
|
||||
if (Group* group = sObjectMgr->GetGroupByStorageId((*resultGroup)[0].GetUInt32()))
|
||||
if (Group* group = sGroupMgr->GetGroupByDbStoreId((*resultGroup)[0].GetUInt32()))
|
||||
RemoveFromGroup(group, playerguid);
|
||||
|
||||
// Remove signs from petitions (also remove petitions if owner);
|
||||
@@ -17722,7 +17723,7 @@ void Player::_LoadGroup(PreparedQueryResult result)
|
||||
//QueryResult *result = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", GetGUIDLow());
|
||||
if (result)
|
||||
{
|
||||
if (Group* group = sObjectMgr->GetGroupByStorageId((*result)[0].GetUInt32()))
|
||||
if (Group* group = sGroupMgr->GetGroupByDbStoreId((*result)[0].GetUInt32()))
|
||||
{
|
||||
uint8 subgroup = group->GetMemberGroup(GetGUID());
|
||||
SetGroup(group, subgroup);
|
||||
|
||||
Reference in New Issue
Block a user