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

Method isPlantMarked

library/modules/Designations.cpp:57–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57bool Designations::isPlantMarked(const df::plant *plant)
58{
59 CHECK_NULL_POINTER(plant);
60
61 df::coord des_pos = getPlantDesignationTile(plant);
62 df::map_block *block = Maps::getTileBlock(des_pos);
63 if (!block)
64 return false;
65
66 if (block->designation[des_pos.x % 16][des_pos.y % 16].bits.dig == tile_dig_designation::Default)
67 return true;
68
69 for (auto *link = world->jobs.list.next; link; link = link->next)
70 {
71 df::job *job = link->item;
72 if (!job)
73 continue;
74 if (job->job_type != job_type::FellTree && job->job_type != job_type::GatherPlants)
75 continue;
76 if (job->pos == des_pos)
77 return true;
78 }
79 return false;
80}
81
82bool Designations::canMarkPlant(const df::plant *plant)
83{

Callers

nothing calls this directly

Calls 1

getTileBlockFunction · 0.85

Tested by

no test coverage detected