issue #2043 - `designate` now marks trees (regardless of if ripe).

The `ripe` call was returning false on tree tiles, resulting in an
inability to designate trees for chopping with `getplants`.
This change adds a check to see if the tile is a tree or not and
if it is, then the ripe check is ignored.
develop
gearsix 2023-01-27 14:19:29 +00:00
parent 6e1ab8d67b
commit 6726b567a1
1 changed files with 4 additions and 4 deletions

@ -322,9 +322,9 @@ bool designate(const df::plant *plant, bool farming) {
} }
} }
if ((!farming || seedSource) && bool istree = (tileMaterial(Maps::getTileBlock(plant->pos)->tiletype[plant->pos.x % 16][plant->pos.y % 16]) == tiletype_material::TREE);
ripe(plant->pos.x, plant->pos.y, plant_raw->growths[i]->timing_1, plant_raw->growths[i]->timing_2) && bool isripe = ripe(plant->pos.x, plant->pos.y, plant_raw->growths[i]->timing_1, plant_raw->growths[i]->timing_2);
!picked(plant, i)) if ((!farming || seedSource) && (istree || isripe) && !picked(plant, i))
{ {
return Designations::markPlant(plant); return Designations::markPlant(plant);
} }
@ -429,7 +429,7 @@ command_result df_getplants (color_ostream &out, vector <string> & parameters)
// plantSelections[i] = selectablePlant(out, plant, farming); // plantSelections[i] = selectablePlant(out, plant, farming);
plantSelections[i] = selectablePlant(plant, farming); plantSelections[i] = selectablePlant(plant, farming);
} }
else if (plantNames.find(plant->id) != plantNames.end()) else if (plantNames.find(plant->id) != plantNames.end())
{ {
plantNames.erase(plant->id); plantNames.erase(plant->id);
// plantSelections[i] = selectablePlant(out, plant, farming); // plantSelections[i] = selectablePlant(out, plant, farming);