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

Function set_tt

plugins/plant.cpp:412–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412static void set_tt(const df::coord &pos)
413{ // Set tiletype to grass or soil floor
414 auto block = Maps::getTileBlock(pos);
415 if (!block)
416 return;
417
418 int tx = pos.x & 15, ty = pos.y & 15;
419 if (has_grass(block, tx, ty))
420 block->tiletype[tx][ty] = findRandomVariant((rand() & 1) ? tiletype::GrassLightFloor1 : tiletype::GrassDarkFloor1);
421 else
422 block->tiletype[tx][ty] = findRandomVariant(tiletype::SoilFloor1);
423}
424
425command_result df_removeplant(color_ostream &out, const cuboid &bounds, const plant_options &options, vector<int32_t> *filter = nullptr)
426{

Callers 1

df_removeplantFunction · 0.85

Calls 3

getTileBlockFunction · 0.85
has_grassFunction · 0.85
findRandomVariantFunction · 0.85

Tested by

no test coverage detected