| 431 | } |
| 432 | |
| 433 | bool MapExtras::Block::setSoilAt(df::coord2d pos, df::tiletype tile, bool kill_veins) |
| 434 | { |
| 435 | using namespace df::enums::tiletype_material; |
| 436 | |
| 437 | if (!block) |
| 438 | return false; |
| 439 | |
| 440 | if (!isCoreMaterial(tile)) |
| 441 | return false; |
| 442 | |
| 443 | if (!basemats) |
| 444 | init_tiles(true); |
| 445 | |
| 446 | pos = pos & 15; |
| 447 | auto &cur_tile = tiles->base_tiles[pos.x][pos.y]; |
| 448 | |
| 449 | tile = matchTileMaterial(tile, SOIL); |
| 450 | if (tile == tiletype::Void) |
| 451 | return false; |
| 452 | |
| 453 | if (kill_veins && !setVeinMaterialAt(pos, -1)) |
| 454 | return false; |
| 455 | |
| 456 | if (cur_tile != tile) |
| 457 | { |
| 458 | dirty_tiles = true; |
| 459 | tiles->set_base_tile(pos, tile); |
| 460 | } |
| 461 | |
| 462 | int mat = layerMaterialAt(pos); |
| 463 | if (BlockInfo::getGroundType(mat) == BlockInfo::G_STONE) |
| 464 | mat = biomeInfoAt(pos).default_soil; |
| 465 | |
| 466 | basemats->set_base_mat(tiles, pos, 0, mat); |
| 467 | |
| 468 | return true; |
| 469 | } |
| 470 | |
| 471 | df::tiletype MapExtras::Block::tiletypeAt(df::coord2d p) |
| 472 | { |
no test coverage detected