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

Function tile_muddy

plugins/plant.cpp:77–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75const int32_t sapling_to_tree_threshold = 120 * 28 * 12 * 3 - 1; // 3 years minus 1; let the game handle the actual growing-up
76
77static bool tile_muddy(const df::coord &pos)
78{ // True if tile has mud spatter
79 auto block = Maps::getTileBlock(pos);
80 if (!block)
81 return false;
82
83 for (auto blev : block->block_events)
84 {
85 if (blev->getType() != block_square_event_type::material_spatter)
86 continue;
87
88 auto &ms_ev = *(df::block_square_event_material_spatterst *)blev;
89 if (ms_ev.mat_type == builtin_mats::MUD)
90 return ms_ev.amount[pos.x&15][pos.y&15] > 0;
91 }
92
93 return false;
94}
95
96static bool tile_watery(const df::coord &pos)
97{ // Determines if plant should be in wet or dry vector

Callers 1

df_createplantFunction · 0.85

Calls 2

getTileBlockFunction · 0.85
getTypeMethod · 0.80

Tested by

no test coverage detected