| 310 | |
| 311 | |
| 312 | bool cWorldStorage::LoadChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ) |
| 313 | { |
| 314 | if (m_World->IsChunkValid(a_ChunkX, a_ChunkZ)) |
| 315 | { |
| 316 | // Already loaded (can happen, since the queue is async) |
| 317 | return true; |
| 318 | } |
| 319 | |
| 320 | cChunkCoords Coords(a_ChunkX, a_ChunkY, a_ChunkZ); |
| 321 | |
| 322 | // First try the schema that is used for saving |
| 323 | if (m_SaveSchema->LoadChunk(Coords)) |
| 324 | { |
| 325 | return true; |
| 326 | } |
| 327 | |
| 328 | // If it didn't have the chunk, try all the other schemas: |
| 329 | for (cWSSchemaList::iterator itr = m_Schemas.begin(); itr != m_Schemas.end(); ++itr) |
| 330 | { |
| 331 | if (((*itr) != m_SaveSchema) && (*itr)->LoadChunk(Coords)) |
| 332 | { |
| 333 | return true; |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | // Notify the chunk owner that the chunk failed to load (sets cChunk::m_HasLoadFailed to true): |
| 338 | m_World->ChunkLoadFailed(a_ChunkX, a_ChunkY, a_ChunkZ); |
| 339 | |
| 340 | return false; |
| 341 | } |
| 342 | |
| 343 | |
| 344 |
nothing calls this directly
no test coverage detected