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

Function has_grass

plugins/plant.cpp:397–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397static bool has_grass(df::map_block *block, int tx, int ty)
398{ // Block tile has grass
399 for (auto blev : block->block_events)
400 {
401 if (blev->getType() != block_square_event_type::grass)
402 continue;
403
404 auto &g_ev = *(df::block_square_event_grassst *)blev;
405 if (g_ev.amount[tx][ty] > 0)
406 return true;
407 }
408
409 return false;
410}
411
412static void set_tt(const df::coord &pos)
413{ // Set tiletype to grass or soil floor

Callers 1

set_ttFunction · 0.85

Calls 1

getTypeMethod · 0.80

Tested by

no test coverage detected