aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level0.cpp
diff options
context:
space:
mode:
authorXTZGZoReX <none@none>2010-03-13 16:17:25 +0100
committerXTZGZoReX <none@none>2010-03-13 16:17:25 +0100
commitf8c5b9a4a7fcd73777713f9f518dbda71ada7bb4 (patch)
tree198c2a0879ac6a4becb7ef60176bf0334d7edd4c /src/game/Level0.cpp
parent76afec204d7bbffd21c1a148cd7137c23c033573 (diff)
** Cleanup in ObjectAccessor/HashMapHolder:
* Correctly lock the HashMapHolder on access. * Use ObjectAccessor wrappers (GetPlayers, GetCreatures, GetGameObjects) instead of raw HashMapHolder<Type>::GetContainer. * General code style cleanup. --HG-- branch : trunk
Diffstat (limited to 'src/game/Level0.cpp')
-rw-r--r--src/game/Level0.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp
index b1853c93d77..3117bfaacb0 100644
--- a/src/game/Level0.cpp
+++ b/src/game/Level0.cpp
@@ -165,9 +165,9 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
{
bool first = true;
- HashMapHolder<Player>::MapType &m = HashMapHolder<Player>::GetContainer();
- HashMapHolder<Player>::MapType::const_iterator itr = m.begin();
- for (; itr != m.end(); ++itr)
+ ObjectAccessor::Guard guard(*HashMapHolder<Player>::GetLock());
+ HashMapHolder<Player>::MapType &m = ObjectAccessor::Instance().GetPlayers();
+ for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= sWorld.getConfig(CONFIG_GM_LEVEL_IN_GM_LIST))) &&