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

Method markPlant

library/modules/Designations.cpp:92–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92bool Designations::markPlant(const df::plant *plant)
93{
94 CHECK_NULL_POINTER(plant);
95
96 if (canMarkPlant(plant))
97 {
98 df::coord des_pos = getPlantDesignationTile(plant);
99 df::map_block *block = Maps::getTileBlock(des_pos);
100 block->designation[des_pos.x % 16][des_pos.y % 16].bits.dig = tile_dig_designation::Default;
101 block->flags.bits.designated = true;
102 return true;
103 }
104 else
105 {
106 return false;
107 }
108}
109
110bool Designations::canUnmarkPlant(const df::plant *plant)
111{

Callers

nothing calls this directly

Calls 1

getTileBlockFunction · 0.85

Tested by

no test coverage detected