| 1287 | |
| 1288 | |
| 1289 | void cWorld::GrowTreeImage(const sSetBlockVector & a_Blocks) |
| 1290 | { |
| 1291 | // Check that the tree has place to grow |
| 1292 | |
| 1293 | // Make a copy of the log blocks: |
| 1294 | sSetBlockVector b2; |
| 1295 | for (sSetBlockVector::const_iterator itr = a_Blocks.begin(); itr != a_Blocks.end(); ++itr) |
| 1296 | { |
| 1297 | if (itr->BlockType == E_BLOCK_LOG) |
| 1298 | { |
| 1299 | b2.push_back(*itr); |
| 1300 | } |
| 1301 | } // for itr - a_Blocks[] |
| 1302 | |
| 1303 | // Query blocktypes and metas at those log blocks: |
| 1304 | if (!GetBlocks(b2, false)) |
| 1305 | { |
| 1306 | return; |
| 1307 | } |
| 1308 | |
| 1309 | // Check that at each log's coord there's an block allowed to be overwritten: |
| 1310 | for (sSetBlockVector::const_iterator itr = b2.begin(); itr != b2.end(); ++itr) |
| 1311 | { |
| 1312 | switch (itr->BlockType) |
| 1313 | { |
| 1314 | CASE_TREE_ALLOWED_BLOCKS: |
| 1315 | { |
| 1316 | break; |
| 1317 | } |
| 1318 | default: |
| 1319 | { |
| 1320 | return; |
| 1321 | } |
| 1322 | } |
| 1323 | } // for itr - b2[] |
| 1324 | |
| 1325 | // All ok, replace blocks with the tree image: |
| 1326 | m_ChunkMap->ReplaceTreeBlocks(a_Blocks); |
| 1327 | } |
| 1328 | |
| 1329 | |
| 1330 |
nothing calls this directly
no test coverage detected