| 1175 | |
| 1176 | |
| 1177 | NIBBLETYPE cChunkMap::GetBlockMeta(int a_BlockX, int a_BlockY, int a_BlockZ) |
| 1178 | { |
| 1179 | // First check if it isn't queued in the m_FastSetBlockQueue: |
| 1180 | { |
| 1181 | cCSLock Lock(m_CSFastSetBlock); |
| 1182 | for (sSetBlockList::iterator itr = m_FastSetBlockQueue.begin(); itr != m_FastSetBlockQueue.end(); ++itr) |
| 1183 | { |
| 1184 | if ((itr->x == a_BlockX) && (itr->y == a_BlockY) && (itr->z == a_BlockZ)) |
| 1185 | { |
| 1186 | return itr->BlockMeta; |
| 1187 | } |
| 1188 | } // for itr - m_FastSetBlockQueue[] |
| 1189 | } |
| 1190 | int ChunkX, ChunkZ; |
| 1191 | cChunkDef::AbsoluteToRelative(a_BlockX, a_BlockY, a_BlockZ, ChunkX, ChunkZ ); |
| 1192 | |
| 1193 | cCSLock Lock(m_CSLayers); |
| 1194 | cChunkPtr Chunk = GetChunk( ChunkX, ZERO_CHUNK_Y, ChunkZ ); |
| 1195 | if ((Chunk != NULL) && Chunk->IsValid() ) |
| 1196 | { |
| 1197 | return Chunk->GetMeta(a_BlockX, a_BlockY, a_BlockZ); |
| 1198 | } |
| 1199 | return 0; |
| 1200 | } |
| 1201 | |
| 1202 | |
| 1203 |
no test coverage detected