[9284] Realy fixed crash source added in [9228] now.

This commit is contained in:
VladimirMangos 2010-02-02 14:51:53 +03:00
parent 868a4d20a4
commit 66c8c75914
4 changed files with 11 additions and 7 deletions

View file

@ -1251,12 +1251,14 @@ void Group::_setLeader(const uint64 &guid)
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
} }
uint32 old_guidlow = m_leaderGuid;
m_leaderGuid = slot->guid; m_leaderGuid = slot->guid;
m_leaderName = slot->name; m_leaderName = slot->name;
// Non-BG groups stored in sObjectMgr with leader low-guids as keys // Non-BG groups stored in sObjectMgr with leader low-guids as keys
if (IsCreated() && !isBGGroup()) if (IsCreated() && !isBGGroup())
sObjectMgr.UpdateGroup(this); sObjectMgr.UpdateGroup(old_guidlow,this);
} }

View file

@ -8415,6 +8415,12 @@ void ObjectMgr::RemoveGroup( Group* group )
mGroupMap.erase(GUID_LOPART(group->GetLeaderGUID())); mGroupMap.erase(GUID_LOPART(group->GetLeaderGUID()));
} }
void ObjectMgr::UpdateGroup( uint32 old_guidlow, Group* group )
{
mGroupMap.erase(old_guidlow);
AddGroup(group);
}
void ObjectMgr::AddArenaTeam( ArenaTeam* arenaTeam ) void ObjectMgr::AddArenaTeam( ArenaTeam* arenaTeam )
{ {
mArenaTeamMap[arenaTeam->GetId()] = arenaTeam; mArenaTeamMap[arenaTeam->GetId()] = arenaTeam;

View file

@ -411,11 +411,7 @@ class ObjectMgr
Group * GetGroupByLeaderLowGUID(uint32 lowguid) const; Group * GetGroupByLeaderLowGUID(uint32 lowguid) const;
void AddGroup(Group* group); void AddGroup(Group* group);
void RemoveGroup(Group* group); void RemoveGroup(Group* group);
void UpdateGroup(Group* group) // when need update leader guid as group key void UpdateGroup(uint32 old_guidlow, Group* group); // when need update leader guid as group key
{
RemoveGroup(group);
AddGroup(group);
}
Guild* GetGuildByLeader(uint64 const&guid) const; Guild* GetGuildByLeader(uint64 const&guid) const;
Guild* GetGuildById(uint32 GuildId) const; Guild* GetGuildById(uint32 GuildId) const;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9283" #define REVISION_NR "9284"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__