|
|
@ -10,24 +10,26 @@
|
|
|
|
#include "DataDefs.h"
|
|
|
|
#include "DataDefs.h"
|
|
|
|
#include "TileTypes.h"
|
|
|
|
#include "TileTypes.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "df/world.h"
|
|
|
|
|
|
|
|
#include "df/map_block.h"
|
|
|
|
|
|
|
|
#include "df/tile_dig_designation.h"
|
|
|
|
|
|
|
|
#include "df/plant_raw.h"
|
|
|
|
|
|
|
|
#include "df/plant.h"
|
|
|
|
|
|
|
|
#include "df/ui.h"
|
|
|
|
|
|
|
|
#include "df/burrow.h"
|
|
|
|
#include "df/burrow.h"
|
|
|
|
#include "df/item_flags.h"
|
|
|
|
|
|
|
|
#include "df/item.h"
|
|
|
|
#include "df/item.h"
|
|
|
|
|
|
|
|
#include "df/item_flags.h"
|
|
|
|
#include "df/items_other_id.h"
|
|
|
|
#include "df/items_other_id.h"
|
|
|
|
|
|
|
|
#include "df/job.h"
|
|
|
|
|
|
|
|
#include "df/map_block.h"
|
|
|
|
|
|
|
|
#include "df/plant.h"
|
|
|
|
|
|
|
|
#include "df/plant_raw.h"
|
|
|
|
|
|
|
|
#include "df/tile_dig_designation.h"
|
|
|
|
|
|
|
|
#include "df/ui.h"
|
|
|
|
#include "df/viewscreen_dwarfmodest.h"
|
|
|
|
#include "df/viewscreen_dwarfmodest.h"
|
|
|
|
|
|
|
|
#include "df/world.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "modules/Screen.h"
|
|
|
|
|
|
|
|
#include "modules/Maps.h"
|
|
|
|
|
|
|
|
#include "modules/Burrows.h"
|
|
|
|
#include "modules/Burrows.h"
|
|
|
|
#include "modules/World.h"
|
|
|
|
#include "modules/Designations.h"
|
|
|
|
#include "modules/MapCache.h"
|
|
|
|
|
|
|
|
#include "modules/Gui.h"
|
|
|
|
#include "modules/Gui.h"
|
|
|
|
|
|
|
|
#include "modules/MapCache.h"
|
|
|
|
|
|
|
|
#include "modules/Maps.h"
|
|
|
|
|
|
|
|
#include "modules/Screen.h"
|
|
|
|
|
|
|
|
#include "modules/World.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include <set>
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
|
|
|
@ -228,38 +230,33 @@ static int do_chop_designation(bool chop, bool count_only)
|
|
|
|
if (!count_only && !watchedBurrows.isValidPos(plant->pos))
|
|
|
|
if (!count_only && !watchedBurrows.isValidPos(plant->pos))
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
bool dirty = false;
|
|
|
|
if (chop && !Designations::isPlantMarked(plant))
|
|
|
|
if (chop && cur->designation[x][y].bits.dig == tile_dig_designation::No)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (count_only)
|
|
|
|
if (count_only)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
++count;
|
|
|
|
if (Designations::canMarkPlant(plant))
|
|
|
|
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cur->designation[x][y].bits.dig = tile_dig_designation::Default;
|
|
|
|
if (Designations::markPlant(plant))
|
|
|
|
dirty = true;
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!chop && cur->designation[x][y].bits.dig == tile_dig_designation::Default)
|
|
|
|
if (!chop && Designations::isPlantMarked(plant))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (count_only)
|
|
|
|
if (count_only)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
++count;
|
|
|
|
if (Designations::canUnmarkPlant(plant))
|
|
|
|
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cur->designation[x][y].bits.dig = tile_dig_designation::No;
|
|
|
|
if (Designations::unmarkPlant(plant))
|
|
|
|
dirty = true;
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (dirty)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cur->flags.bits.designated = true;
|
|
|
|
|
|
|
|
++count;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return count;
|
|
|
|
return count;
|
|
|
|