diff options
author | leak <leakzx@googlemail.com> | 2011-03-10 22:21:50 +0100 |
---|---|---|
committer | leak <leakzx@googlemail.com> | 2011-03-10 22:22:29 +0100 |
commit | b6074f90daf344d88471f8875dbea3fd3ccaee7d (patch) | |
tree | b16f29d59ef6bef577549ef580c537440c0db734 /src/server/game/Globals/ObjectMgr.cpp | |
parent | 5b481d36bf1ad4789f8ae664c59b96beea7684c9 (diff) |
Core: Cleaned up leftovers from loading functions streamlining
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index ae028b7b7a1..964c9aae9d9 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -3679,18 +3679,18 @@ void ObjectMgr::LoadGuilds() mGuildMap.resize(m_guildId, NULL); // Reserve space and initialize storage for loading guilds //TODOLEAK: fix this shit uint32 count = 0; - do { - Field* fields = result->Fetch(); Guild* pNewGuild = new Guild(); + if (!pNewGuild->LoadFromDB(fields)) { delete pNewGuild; continue; } AddGuild(pNewGuild); + ++count; } while (result->NextRow()); @@ -3720,14 +3720,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) - pGuild->LoadRankFromDB(fields); //TODOLEAK: untangle that shit + pGuild->LoadRankFromDB(fields); + ++count; } while (result->NextRow()); @@ -3760,11 +3760,12 @@ void ObjectMgr::LoadGuilds() do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadMemberFromDB(fields); + ++count; } while (result->NextRow()); @@ -3794,14 +3795,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadBankRightFromDB(fields); + ++count; } while (result->NextRow()); @@ -3831,14 +3832,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadEventLogFromDB(fields); + ++count; } while (result->NextRow()); @@ -3869,14 +3870,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadBankEventLogFromDB(fields); + ++count; } while (result->NextRow()); @@ -3906,14 +3907,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadBankTabFromDB(fields); + ++count; } while (result->NextRow()); @@ -3943,14 +3944,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[11].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadBankItemFromDB(fields); + ++count; } while (result->NextRow()); |