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

Function RemoveBlockEventInline

library/modules/Maps.cpp:907–921  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

905}
906
907inline bool RemoveBlockEventInline(int32_t x, int32_t y, int32_t z, df::block_square_event * which)
908{
909 df::map_block *block = Maps::getBlock(x, y, z);
910 if (!block)
911 return false;
912 int idx = linear_index(block->block_events, which);
913 if (idx >= 0)
914 {
915 delete which;
916 vector_erase_at(block->block_events, idx);
917 return true;
918 }
919 else
920 return false;
921}
922inline bool Maps::RemoveBlockEvent(int32_t x, int32_t y, int32_t z, df::block_square_event * which)
923{
924 return RemoveBlockEventInline(x, y, z, which);

Callers 1

RemoveBlockEventMethod · 0.85

Calls 3

getBlockFunction · 0.85
vector_erase_atFunction · 0.85
linear_indexFunction · 0.50

Tested by

no test coverage detected