From ca1e026c4f47487ed30f4b67fc1f152d84d9ee14 Mon Sep 17 00:00:00 2001 From: maximius Date: Sat, 31 Oct 2009 01:24:12 -0700 Subject: *Fix build with mtmaps :/ --HG-- branch : trunk --- src/game/MapManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/game/MapManager.cpp') diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp index 6cef6d58298..047b9a352b3 100644 --- a/src/game/MapManager.cpp +++ b/src/game/MapManager.cpp @@ -300,22 +300,21 @@ MapManager::Update(uint32 diff) MapMapType::iterator iter = i_maps.begin(); #ifdef MULTI_THREAD_MAP - uint32 i; std::vector update_queue(i_maps.size()); int omp_set_num_threads(sWorld.getConfig(CONFIG_NUMTHREADS)); - for (i = 0; iter != i_maps.end(); ++iter, ++i) + for (uint32 i = 0; iter != i_maps.end(); ++iter, ++i) update_queue[i] = iter->second; /* gomp in gcc <4.4 version cannot parallelise loops using random access iterators so until gcc 4.4 isnt standard, we need the update_queue workaround */ #pragma omp parallel for schedule(dynamic) private(i) shared(update_queue) - for (; i > 0; --i) + for (uint32 i = 0; i < i_maps.size(); ++i) { checkAndCorrectGridStatesArray(); // debugging code, should be deleted some day update_queue[i]->Update(i_timer.GetCurrent()); sWorld.RecordTimeDiff("UpdateMap %u", update_queue[i]->GetId()); - // sLog.outError("This is thread %d out of %d threads,updating map %u",omp_get_thread_num(),omp_get_num_threads(),iter->second->GetId()); + //sLog.outError("This is thread %d out of %d threads,updating map %u",omp_get_thread_num(),omp_get_num_threads(),iter->second->GetId()); } #else for (; iter != i_maps.end(); ++iter) -- cgit v1.2.3