MCPcopy Create free account
hub / github.com/DFHack/dfhack / deletePersistentTilemask

Method deletePersistentTilemask

library/modules/World.cpp:330–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330bool 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}

Callers

nothing calls this directly

Calls 4

vector_erase_atFunction · 0.85
fake_df_idMethod · 0.80
getTypeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected