diff --git a/src/game/Group.cpp b/src/game/Group.cpp index 9f88a1fb3..2a0a4a92f 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -1253,6 +1253,11 @@ void Group::_setLeader(const uint64 &guid) m_leaderGuid = slot->guid; m_leaderName = slot->name; + + // Non-BG groups stored in sObjectMgr with leader low-guids as keys + if (IsCreated() && !isBGGroup()) + sObjectMgr.UpdateGroup(this); + } void Group::_removeRolls(const uint64 &guid) diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index d27a2fe7e..c09c42317 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -411,6 +411,11 @@ class ObjectMgr Group * GetGroupByLeaderLowGUID(uint32 lowguid) const; void AddGroup(Group* group); void RemoveGroup(Group* group); + void UpdateGroup(Group* group) // when need update leader guid as group key + { + RemoveGroup(group); + AddGroup(group); + } Guild* GetGuildByLeader(uint64 const&guid) const; Guild* GetGuildById(uint32 GuildId) const; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9e25f9817..9a523873e 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9281" + #define REVISION_NR "9282" #endif // __REVISION_NR_H__