From 44a1edac30cd30fb6b127190adf6a45800d7ab00 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 19 Dec 2014 20:11:22 +1100 Subject: [PATCH] HOTFIX: Patched the stupid auto& for loop with the jenky pattern --- server/server_methods.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/server/server_methods.cpp b/server/server_methods.cpp index b3e77c6..b6287c2 100644 --- a/server/server_methods.cpp +++ b/server/server_methods.cpp @@ -92,9 +92,13 @@ void ServerApplication::FullClientUnload(int index) { } //unload associated accounts - for (auto& it : *accountMgr.GetContainer()) { - if (it.second.GetClientIndex() == index) { - FullAccountUnload(it.first); + for (std::map::iterator it = accountMgr.GetContainer()->begin(); it != accountMgr.GetContainer()->end(); /* EMPTY */) { + if (it->second.GetClientIndex() == index) { + FullAccountUnload(it->first); + it = accountMgr.GetContainer()->begin(); + } + else { + ++it; } } @@ -111,9 +115,13 @@ void ServerApplication::FullAccountUnload(int index) { } //unload associated characters - for (auto& it : *characterMgr.GetContainer()) { - if (it.second.GetOwner() == index) { - FullCharacterUnload(it.first); + for (std::map::iterator it = characterMgr.GetContainer()->begin(); it != characterMgr.GetContainer()->end(); /* EMPTY */) { + if (it->second.GetOwner() == index) { + FullCharacterUnload(it->first); + it = characterMgr.GetContainer()->begin(); + } + else { + ++it; } }