| 2372 | |
| 2373 | |
| 2374 | bool cChunkMap::ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a_MinChunkZ, int a_MaxChunkZ, cChunkDataCallback & a_Callback) |
| 2375 | { |
| 2376 | bool Result = true; |
| 2377 | cCSLock Lock(m_CSLayers); |
| 2378 | for (int z = a_MinChunkZ; z <= a_MaxChunkZ; z++) |
| 2379 | { |
| 2380 | for (int x = a_MinChunkX; x <= a_MaxChunkX; x++) |
| 2381 | { |
| 2382 | cChunkPtr Chunk = GetChunkNoLoad(x, ZERO_CHUNK_Y, z); |
| 2383 | if ((Chunk == NULL) || (!Chunk->IsValid())) |
| 2384 | { |
| 2385 | // Not present / not valid |
| 2386 | Result = false; |
| 2387 | continue; |
| 2388 | } |
| 2389 | if (!a_Callback.Coords(x, z)) |
| 2390 | { |
| 2391 | continue; |
| 2392 | } |
| 2393 | Chunk->GetAllData(a_Callback); |
| 2394 | } |
| 2395 | } |
| 2396 | return Result; |
| 2397 | } |
| 2398 | |
| 2399 | |
| 2400 |
nothing calls this directly
no test coverage detected