mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[9228] Speedup groups store and other code work.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
4995a6d298
commit
4178d5bb6a
7 changed files with 74 additions and 91 deletions
|
|
@ -3973,13 +3973,10 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
|||
QueryResult *resultGroup = CharacterDatabase.PQuery("SELECT leaderGuid FROM group_member WHERE memberGuid='%u'", guid);
|
||||
if(resultGroup)
|
||||
{
|
||||
uint64 leaderGuid = MAKE_NEW_GUID((*resultGroup)[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
uint32 leaderGuidLow = (*resultGroup)[0].GetUInt32();
|
||||
delete resultGroup;
|
||||
Group* group = sObjectMgr.GetGroupByLeader(leaderGuid);
|
||||
if(group)
|
||||
{
|
||||
if (Group* group = sObjectMgr.GetGroupByLeaderLowGUID(leaderGuidLow))
|
||||
RemoveFromGroup(group, playerguid);
|
||||
}
|
||||
}
|
||||
|
||||
// remove signs from petitions (also remove petitions if owner);
|
||||
|
|
@ -15781,10 +15778,10 @@ void Player::_LoadGroup(QueryResult *result)
|
|||
//QueryResult *result = CharacterDatabase.PQuery("SELECT leaderGuid FROM group_member WHERE memberGuid='%u'", GetGUIDLow());
|
||||
if (result)
|
||||
{
|
||||
uint64 leaderGuid = MAKE_NEW_GUID((*result)[0].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
uint32 leaderGuidLow = (*result)[0].GetUInt32();
|
||||
delete result;
|
||||
|
||||
if (Group* group = sObjectMgr.GetGroupByLeader(leaderGuid))
|
||||
if (Group* group = sObjectMgr.GetGroupByLeaderLowGUID(leaderGuidLow))
|
||||
{
|
||||
uint8 subgroup = group->GetMemberGroup(GetGUID());
|
||||
SetGroup(group, subgroup);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue