| 340 | } |
| 341 | |
| 342 | bool MapExtras::Block::setVeinMaterialAt(df::coord2d pos, int16_t mat, df::inclusion_type type) |
| 343 | { |
| 344 | using namespace df::enums::tiletype_material; |
| 345 | |
| 346 | if (!block) |
| 347 | return false; |
| 348 | |
| 349 | if (!basemats) |
| 350 | init_tiles(true); |
| 351 | |
| 352 | pos = pos & 15; |
| 353 | auto &cur_mat = basemats->veinmat[pos.x][pos.y]; |
| 354 | auto &cur_type = basemats->veintype[pos.x][pos.y]; |
| 355 | |
| 356 | if (cur_mat == mat && (mat < 0 || cur_type == type)) |
| 357 | return true; |
| 358 | |
| 359 | if (mat >= 0) |
| 360 | { |
| 361 | // Cannot allocate veins? |
| 362 | if (!df::block_square_event_mineralst::_identity.can_instantiate()) |
| 363 | return false; |
| 364 | |
| 365 | // Bad material? |
| 366 | if (!isStoneInorganic(mat)) |
| 367 | return false; |
| 368 | } |
| 369 | |
| 370 | dirty_veins = true; |
| 371 | cur_mat = mat; |
| 372 | cur_type = (uint8_t)type; |
| 373 | basemats->vein_dirty.setassignment(pos, true); |
| 374 | |
| 375 | if (tileMaterial(tiles->base_tiles[pos.x][pos.y]) == MINERAL) |
| 376 | basemats->set_base_mat(tiles, pos, 0, mat); |
| 377 | |
| 378 | return true; |
| 379 | } |
| 380 | |
| 381 | bool MapExtras::Block::setStoneAt(df::coord2d pos, df::tiletype tile, int16_t mat, df::inclusion_type type, bool force_vein, bool kill_veins) |
| 382 | { |
no test coverage detected