mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
This should fix crashes introduced in revision 4e75fea59c6c (9138)
--HG-- branch : trunk
This commit is contained in:
@@ -199,8 +199,8 @@ ObjectMgr::~ObjectMgr()
|
||||
delete[] playerInfo[race][class_].levelInfo;
|
||||
|
||||
// free group and guild objects
|
||||
for (GroupMap::iterator itr = mGroupMap.begin(); itr != mGroupMap.end(); ++itr)
|
||||
delete itr->second;
|
||||
for (GroupSet::iterator itr = mGroupSet.begin(); itr != mGroupSet.end(); ++itr)
|
||||
delete *itr;
|
||||
|
||||
for (GuildMap::iterator itr = mGuildMap.begin(); itr != mGuildMap.end(); ++itr)
|
||||
delete itr->second;
|
||||
@@ -215,11 +215,11 @@ ObjectMgr::~ObjectMgr()
|
||||
itr->second.Clear();
|
||||
}
|
||||
|
||||
Group * ObjectMgr::GetGroupByGUID(const uint32 &guid) const
|
||||
Group * ObjectMgr::GetGroupByGUID(uint32 guid) const
|
||||
{
|
||||
GroupMap::const_iterator itr = mGroupMap.find(guid);
|
||||
if (itr != mGroupMap.end())
|
||||
return itr->second;
|
||||
for (GroupSet::const_iterator itr = mGroupSet.begin(); itr != mGroupSet.end(); ++itr)
|
||||
if ((*itr)->GetLowGUID() == guid)
|
||||
return *itr;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ class ObjectMgr
|
||||
public:
|
||||
typedef UNORDERED_MAP<uint32, Item*> ItemMap;
|
||||
|
||||
typedef UNORDERED_MAP<uint32, Group *> GroupMap;
|
||||
typedef std::set<Group *> GroupSet;
|
||||
|
||||
typedef UNORDERED_MAP<uint32, Guild *> GuildMap;
|
||||
|
||||
@@ -410,9 +410,9 @@ class ObjectMgr
|
||||
void LoadGameobjectInfo();
|
||||
void AddGameobjectInfo(GameObjectInfo *goinfo);
|
||||
|
||||
Group * GetGroupByGUID(const uint32 &guid) const;
|
||||
void AddGroup(Group* group) { mGroupMap[group->GetLowGUID()] = group; }
|
||||
void RemoveGroup(Group* group) { mGroupMap.erase(group->GetLowGUID()); }
|
||||
Group * GetGroupByGUID(uint32 guid) const;
|
||||
void AddGroup(Group* group) { mGroupSet.insert(group); }
|
||||
void RemoveGroup(Group* group) { mGroupSet.erase(group); }
|
||||
|
||||
Guild* GetGuildByLeader(uint64 const&guid) const;
|
||||
Guild* GetGuildById(uint32 GuildId) const;
|
||||
@@ -1012,7 +1012,7 @@ class ObjectMgr
|
||||
typedef std::set<uint32> TavernAreaTriggerSet;
|
||||
typedef std::set<uint32> GameObjectForQuestSet;
|
||||
|
||||
GroupMap mGroupMap;
|
||||
GroupSet mGroupSet;
|
||||
GuildMap mGuildMap;
|
||||
ArenaTeamMap mArenaTeamMap;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user