| 328 | } |
| 329 | |
| 330 | bool World::deletePersistentTilemask(PersistentDataItem &item, df::map_block *block) { |
| 331 | if (!block) |
| 332 | return false; |
| 333 | |
| 334 | int id = item.fake_df_id(); |
| 335 | if (id > -100) |
| 336 | return false; |
| 337 | |
| 338 | bool found = false; |
| 339 | for (int i = block->block_events.size()-1; i >= 0; i--) { |
| 340 | auto ev = block->block_events[i]; |
| 341 | if (ev->getType() != block_square_event_type::world_construction) |
| 342 | continue; |
| 343 | auto wcsev = strict_virtual_cast<df::block_square_event_world_constructionst>(ev); |
| 344 | if (!wcsev || wcsev->construction_id != id) |
| 345 | continue; |
| 346 | |
| 347 | delete wcsev; |
| 348 | vector_erase_at(block->block_events, i); |
| 349 | found = true; |
| 350 | } |
| 351 | |
| 352 | return found; |
| 353 | } |
nothing calls this directly
no test coverage detected