| 1473 | |
| 1474 | |
| 1475 | bool cChunkMap::GetBlocks(sSetBlockVector & a_Blocks, bool a_ContinueOnFailure) |
| 1476 | { |
| 1477 | bool res = true; |
| 1478 | cCSLock Lock(m_CSLayers); |
| 1479 | for (sSetBlockVector::iterator itr = a_Blocks.begin(); itr != a_Blocks.end(); ++itr) |
| 1480 | { |
| 1481 | cChunkPtr Chunk = GetChunk(itr->ChunkX, ZERO_CHUNK_Y, itr->ChunkZ ); |
| 1482 | if ((Chunk == NULL) || !Chunk->IsValid()) |
| 1483 | { |
| 1484 | if (!a_ContinueOnFailure) |
| 1485 | { |
| 1486 | return false; |
| 1487 | } |
| 1488 | res = false; |
| 1489 | continue; |
| 1490 | } |
| 1491 | int idx = cChunkDef::MakeIndexNoCheck(itr->x, itr->y, itr->z); |
| 1492 | itr->BlockType = Chunk->GetBlock(idx); |
| 1493 | itr->BlockMeta = Chunk->GetMeta(idx); |
| 1494 | } |
| 1495 | return res; |
| 1496 | } |
| 1497 | |
| 1498 | |
| 1499 | |