| 55 | } |
| 56 | |
| 57 | bool 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 | |
| 82 | bool Designations::canMarkPlant(const df::plant *plant) |
| 83 | { |
nothing calls this directly
no test coverage detected