Merge remote-tracking branch 'q-github/master'

develop
Alexander Gavrilov 2012-01-16 19:55:47 +04:00
commit 89cb12add1
31 changed files with 276 additions and 266 deletions

@ -50,6 +50,18 @@ namespace DFHack
if(bits)
memset(bits, 0, size);
}
void extend (T index)
{
uint32_t newsize = (index / 8) + 1;
if (newsize <= size)
return;
uint8_t *newbits = new uint8_t[newsize];
memset(newbits, 0, newsize);
memcpy(newbits, bits, size);
delete[] bits;
bits = newbits;
size = newsize;
}
void set (T index, bool value = true)
{
if(!value)
@ -58,7 +70,8 @@ namespace DFHack
return;
}
uint32_t byte = index / 8;
if(byte < size)
extend(index);
//if(byte < size)
{
uint8_t bit = 1 << (index % 8);
bits[byte] |= bit;
@ -76,7 +89,8 @@ namespace DFHack
void toggle (T index)
{
uint32_t byte = index / 8;
if(byte < size)
extend(index);
//if(byte < size)
{
uint8_t bit = 1 << (index % 8);
bits[byte] ^= bit;

@ -1,4 +1,4 @@
/*
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
@ -40,14 +40,14 @@ using namespace std;
#include "modules/Items.h"
#include "DataDefs.h"
#include <df/world.h>
#include <df/ui.h>
#include <df/job.h>
#include <df/job_item.h>
#include <df/job_list_link.h>
#include <df/general_ref.h>
#include <df/general_ref_unit_workerst.h>
#include <df/general_ref_building_holderst.h>
#include "df/world.h"
#include "df/ui.h"
#include "df/job.h"
#include "df/job_item.h"
#include "df/job_list_link.h"
#include "df/general_ref.h"
#include "df/general_ref_unit_workerst.h"
#include "df/general_ref_building_holderst.h"
using namespace DFHack;
using namespace df::enums;

@ -5,27 +5,25 @@
#include <sstream>
#include <climits>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
using namespace std;
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <vector>
#include <string>
#include <algorithm>
#include <modules/Maps.h>
#include <modules/Gui.h>
#include <modules/Items.h>
#include <modules/Materials.h>
#include <modules/MapCache.h>
#include <DataDefs.h>
#include <df/item.h>
#include <df/world.h>
#include <df/general_ref_unit_holderst.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Maps.h"
#include "modules/Gui.h"
#include "modules/Items.h"
#include "modules/Materials.h"
#include "modules/MapCache.h"
#include "DataDefs.h"
#include "df/item.h"
#include "df/world.h"
#include "df/general_ref.h"
using namespace DFHack;
using MapExtras::Block;
@ -94,7 +92,7 @@ static command_result autodump_main(Core * c, vector <string> & parameters)
return CR_OK;
}
}
c->Suspend();
DFHack::VersionInfo *mem = c->vinfo;
DFHack::Gui * Gui = c->getGui();
DFHack::Items * Items = c->getItems();
@ -265,7 +263,7 @@ static command_result autodump_main(Core * c, vector <string> & parameters)
// Is this necessary? Is "forbid" a dirtyable attribute like "dig" is?
Maps->WriteDirtyBit(cx/16, cy/16, cz, true);
}
c->con.print("Done. %d items %s.\n", dumped_total, destroy ? "marked for desctruction" : "quickdumped");
c->con.print("Done. %d items %s.\n", dumped_total, destroy ? "marked for destruction" : "quickdumped");
return CR_OK;
}
@ -338,7 +336,7 @@ DFhackCExport command_result df_autodump_destroy_item(Core * c, vector <string>
for (unsigned i = 0; i < item->itemrefs.size(); i++)
{
df::general_ref *ref = item->itemrefs[i];
if (strict_virtual_cast<df::general_ref_unit_holderst>(ref))
if (ref->getType() == df::general_ref_type::unit_holder)
{
c->con.printerr("Choosing not to destroy items in unit inventory.\n");
return CR_FAILURE;

@ -1,7 +1,7 @@
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "DataDefs.h"
#include "df/world.h"
@ -227,4 +227,4 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand>
DFhackCExport command_result plugin_shutdown ( Core * c )
{
return CR_OK;
}
}

@ -9,16 +9,16 @@
using namespace std;
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include <vector>
#include <string>
#include <modules/Maps.h>
#include <modules/Items.h>
#include <modules/Units.h>
#include <modules/Materials.h>
#include <modules/Translation.h>
#include "modules/Maps.h"
#include "modules/Items.h"
#include "modules/Units.h"
#include "modules/Materials.h"
#include "modules/Translation.h"
using namespace DFHack;
DFhackCExport command_result df_cleanowned (Core * c, vector <string> & parameters);

@ -1,16 +1,16 @@
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include <vector>
#include <string>
#include <modules/Vermin.h>
#include "modules/Vermin.h"
#include "modules/Materials.h"
using std::vector;
using std::string;
using namespace DFHack;
using namespace DFHack::Simple;
#include <DFHack.h>
DFhackCExport command_result colonies (Core * c, vector <string> & parameters);
@ -34,8 +34,8 @@ DFhackCExport command_result plugin_shutdown ( Core * c )
}
void destroyColonies();
void convertColonies(DFHack::Materials *Materials);
void showColonies(Core *c, DFHack::Materials *Materials);
void convertColonies(Materials *Materials);
void showColonies(Core *c, Materials *Materials);
DFhackCExport command_result colonies (Core * c, vector <string> & parameters)
{
@ -106,7 +106,7 @@ void destroyColonies()
}
// Convert all colonies to honey bees.
void convertColonies(DFHack::Materials *Materials)
void convertColonies(Materials *Materials)
{
int bee_idx = -1;
for (size_t i = 0; i < Materials->raceEx.size(); i++)
@ -136,7 +136,7 @@ void convertColonies(DFHack::Materials *Materials)
}
}
void showColonies(Core *c, DFHack::Materials *Materials)
void showColonies(Core *c, Materials *Materials)
{
uint32_t numSpawnPoints = Vermin::getNumVermin();
int numColonies = 0;

@ -1,15 +1,15 @@
// De-ramp. All ramps marked for removal are replaced with given tile (presently, normal floor).
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "DataDefs.h"
#include "df/world.h"
#include "df/map_block.h"
#include "df/tile_dig_designation.h"
#include <TileTypes.h>
#include "TileTypes.h"
using std::vector;
using std::string;
@ -111,4 +111,4 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand>
DFhackCExport command_result plugin_shutdown ( Core * c )
{
return CR_OK;
}
}

@ -1,11 +1,11 @@
// Dry Buckets : Remove all "water" objects from buckets scattered around the fortress
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include <DataDefs.h>
#include "DataDefs.h"
#include "df/world.h"
#include "df/item.h"
#include "df/builtin_mats.h"
@ -53,4 +53,4 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand>
DFhackCExport command_result plugin_shutdown ( Core * c )
{
return CR_OK;
}
}

@ -1,9 +1,9 @@
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include <DataDefs.h>
#include "DataDefs.h"
#include "df/ui.h"
#include "df/world.h"
#include "df/unit.h"

@ -6,12 +6,12 @@
#include <map>
#include <vector>
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <modules/Maps.h>
#include <modules/MapCache.h>
#include <modules/Gui.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Maps.h"
#include "modules/MapCache.h"
#include "modules/Gui.h"
using std::stack;
using MapExtras::MapCache;
using namespace DFHack;
@ -377,4 +377,4 @@ void allRestricted(DFHack::DFCoord coord, MapExtras::MapCache * map)
DFHack::t_designation des = map->designationAt(coord);
des.bits.traffic = traffic_restricted;
map->setDesignationAt(coord, des);
}
}

@ -1,11 +1,11 @@
// I'll fix his little red wagon...
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include <DataDefs.h>
#include "DataDefs.h"
#include "df/world.h"
#include "df/historical_entity.h"
#include "df/entity_raw.h"
@ -103,4 +103,4 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand>
DFhackCExport command_result plugin_shutdown ( Core * c )
{
return CR_OK;
}
}

@ -1,11 +1,11 @@
// This tool counts static tiles and active flows of water and magma.
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include <DataDefs.h>
#include "DataDefs.h"
#include "df/world.h"
#include "df/map_block.h"
#include "df/tile_liquid.h"

@ -1,12 +1,12 @@
// Designate all matching plants for gathering/cutting
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include <DataDefs.h>
#include <TileTypes.h>
#include "DataDefs.h"
#include "TileTypes.h"
#include "df/world.h"
#include "df/map_block.h"
#include "df/tile_dig_designation.h"
@ -152,4 +152,4 @@ DFhackCExport command_result plugin_init ( Core * c, vector <PluginCommand> &com
DFhackCExport command_result plugin_shutdown ( Core * c )
{
return CR_OK;
}
}

@ -1,10 +1,10 @@
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include <DataDefs.h>
#include <df/d_init.h>
#include "DataDefs.h"
#include "df/d_init.h"
using std::vector;
using std::string;

@ -1,30 +1,29 @@
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <MiscUtils.h>
#include <modules/Materials.h>
#include <modules/Items.h>
#include <modules/Gui.h>
#include <modules/Job.h>
#include <DataDefs.h>
#include <df/world.h>
#include <df/ui.h>
#include <df/ui_build_selector.h>
#include <df/ui_build_item_req.h>
#include <df/build_req_choice_genst.h>
#include <df/build_req_choice_specst.h>
#include <df/building_workshopst.h>
#include <df/building_furnacest.h>
#include <df/job.h>
#include <df/job_item.h>
#include <df/job_list_link.h>
#include <df/item.h>
#include <df/tool_uses.h>
#include <df/general_ref.h>
#include <df/general_ref_unit_workerst.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "MiscUtils.h"
#include "modules/Materials.h"
#include "modules/Items.h"
#include "modules/Gui.h"
#include "modules/Job.h"
#include "DataDefs.h"
#include "df/world.h"
#include "df/ui.h"
#include "df/ui_build_selector.h"
#include "df/ui_build_item_req.h"
#include "df/build_req_choice_genst.h"
#include "df/build_req_choice_specst.h"
#include "df/building_workshopst.h"
#include "df/building_furnacest.h"
#include "df/job.h"
#include "df/job_item.h"
#include "df/job_list_link.h"
#include "df/item.h"
#include "df/tool_uses.h"
#include "df/general_ref.h"
using std::vector;
using std::string;

@ -10,14 +10,14 @@ using std::endl;
using std::set;
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <modules/Vegetation.h>
#include <modules/Maps.h>
#include <modules/Gui.h>
#include <TileTypes.h>
#include <modules/MapCache.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Vegetation.h"
#include "modules/Maps.h"
#include "modules/Gui.h"
#include "TileTypes.h"
#include "modules/MapCache.h"
using namespace MapExtras;
using namespace DFHack;

@ -2,12 +2,12 @@
using namespace std;
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include <vector>
#include <string>
#include <modules/World.h>
#include "modules/World.h"
#include <stdlib.h>
using namespace DFHack;
@ -169,4 +169,4 @@ DFhackCExport command_result mode (Core * c, vector <string> & parameters)
c->con << endl;
}
return CR_OK;
}
}

@ -6,14 +6,14 @@
#include <string>
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <modules/Vegetation.h>
#include <modules/Maps.h>
#include <modules/Gui.h>
#include <TileTypes.h>
#include <modules/MapCache.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Vegetation.h"
#include "modules/Maps.h"
#include "modules/Gui.h"
#include "TileTypes.h"
#include "modules/MapCache.h"
using std::vector;
using std::string;

@ -4,23 +4,22 @@
#include <iomanip>
#include <climits>
#include <vector>
#include <string>
#include <sstream>
#include <ctime>
#include <cstdio>
using namespace std;
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <vector>
#include <string>
#include <modules/Units.h>
#include <modules/Maps.h>
#include <modules/Gui.h>
#include <modules/Materials.h>
#include <modules/MapCache.h>
#include <MiscUtils.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Units.h"
#include "modules/Maps.h"
#include "modules/Gui.h"
#include "modules/Materials.h"
#include "modules/MapCache.h"
#include "MiscUtils.h"
using std::vector;
using std::string;

@ -13,11 +13,11 @@
#include <vector>
using namespace std;
#include <DFHack.h>
#include <modules/MapCache.h>
#include "Core.h"
#include <Console.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/MapCache.h"
using namespace DFHack;

@ -2,14 +2,14 @@
// Necessary for worlds generated prior to version 0.31.19 - otherwise, outdoor shrubs and trees no longer grow.
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include <DataDefs.h>
#include "DataDefs.h"
#include "df/world.h"
#include "df/map_block.h"
#include <TileTypes.h>
#include "TileTypes.h"
using std::string;
using std::vector;

@ -1,18 +1,18 @@
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <modules/Gui.h>
#include <DataDefs.h>
#include <df/ui.h>
#include <df/world.h>
#include <df/squad.h>
#include <df/unit.h>
#include <df/unit_soul.h>
#include <df/historical_figure.h>
#include <df/language_name.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Gui.h"
#include "DataDefs.h"
#include "df/ui.h"
#include "df/world.h"
#include "df/squad.h"
#include "df/unit.h"
#include "df/unit_soul.h"
#include "df/historical_figure.h"
#include "df/language_name.h"
#include <stdlib.h>

@ -3,13 +3,13 @@
#include <map>
#include <vector>
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <modules/Maps.h>
#include <modules/World.h>
#include <modules/MapCache.h>
#include <modules/Gui.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Maps.h"
#include "modules/World.h"
#include "modules/MapCache.h"
#include "modules/Gui.h"
using MapExtras::MapCache;
using namespace DFHack;
@ -504,4 +504,4 @@ DFhackCExport command_result revflood(DFHack::Core * c, std::vector<std::string>
delete MCache;
c->Resume();
return CR_OK;
}
}

@ -12,7 +12,7 @@
#include "modules/Items.h"
#include "modules/World.h"
#include "modules/kitchen.h"
#include <VersionInfo.h>
#include "VersionInfo.h"
using DFHack::t_materialType;
using DFHack::t_materialIndex;

@ -1,14 +1,14 @@
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <DataDefs.h>
#include <df/world.h>
#include <df/ui.h>
#include <df/building_stockpilest.h>
#include <df/selection_rect.h>
#include <df/viewscreen_dwarfmodest.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "DataDefs.h"
#include "df/world.h"
#include "df/ui.h"
#include "df/building_stockpilest.h"
#include "df/selection_rect.h"
#include "df/viewscreen_dwarfmodest.h"
using std::vector;
using std::string;

@ -11,14 +11,14 @@ using std::endl;
using std::set;
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <modules/Vegetation.h>
#include <modules/Maps.h>
#include <modules/Gui.h>
#include <TileTypes.h>
#include <modules/MapCache.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Vegetation.h"
#include "modules/Maps.h"
#include "modules/Gui.h"
#include "TileTypes.h"
#include "modules/MapCache.h"
using namespace MapExtras;
using namespace DFHack;

@ -5,13 +5,13 @@
#include <map>
#include <vector>
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <modules/Maps.h>
#include <modules/World.h>
#include <modules/MapCache.h>
#include <modules/Gui.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Maps.h"
#include "modules/World.h"
#include "modules/MapCache.h"
#include "modules/Gui.h"
using MapExtras::MapCache;
using namespace DFHack;

@ -1,10 +1,10 @@
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <modules/Maps.h>
#include <modules/Gui.h>
#include <modules/MapCache.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Maps.h"
#include "modules/Gui.h"
#include "modules/MapCache.h"
#include <vector>
#include <cstdio>
#include <stack>

@ -8,11 +8,11 @@
#include <string.h>
using namespace std;
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <modules/Graphic.h>
#include <modules/Gui.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Graphic.h"
#include "modules/Gui.h"
using namespace DFHack;
DFhackCExport command_result df_versionosd (Core * c, vector <string> & parameters);
@ -145,4 +145,4 @@ DFTileSurface* gettile (int x, int y)
}
return NULL;
}
}

@ -1,10 +1,10 @@
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include <vector>
#include <string>
#include <modules/World.h>
#include "modules/World.h"
using std::vector;
using std::string;

@ -1,41 +1,41 @@
#include "Core.h"
#include <Console.h>
#include <Export.h>
#include <PluginManager.h>
#include <MiscUtils.h>
#include <modules/Materials.h>
#include <modules/Items.h>
#include <modules/Gui.h>
#include <modules/Job.h>
#include <modules/World.h>
#include <DataDefs.h>
#include <df/world.h>
#include <df/ui.h>
#include <df/building_workshopst.h>
#include <df/building_furnacest.h>
#include <df/job.h>
#include <df/job_item.h>
#include <df/job_list_link.h>
#include <df/dfhack_material_category.h>
#include <df/item.h>
#include <df/items_other_id.h>
#include <df/tool_uses.h>
#include <df/general_ref.h>
#include <df/general_ref_unit_workerst.h>
#include <df/general_ref_unit_holderst.h>
#include <df/general_ref_building_holderst.h>
#include <df/general_ref_contains_itemst.h>
#include <df/general_ref_contained_in_itemst.h>
#include <df/general_ref_contains_unitst.h>
#include <df/itemdef_foodst.h>
#include <df/reaction.h>
#include <df/reaction_reagent_itemst.h>
#include <df/reaction_product_itemst.h>
#include <df/plant_raw.h>
#include <df/inorganic_raw.h>
#include <df/builtin_mats.h>
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "MiscUtils.h"
#include "modules/Materials.h"
#include "modules/Items.h"
#include "modules/Gui.h"
#include "modules/Job.h"
#include "modules/World.h"
#include "DataDefs.h"
#include "df/world.h"
#include "df/ui.h"
#include "df/building_workshopst.h"
#include "df/building_furnacest.h"
#include "df/job.h"
#include "df/job_item.h"
#include "df/job_list_link.h"
#include "df/dfhack_material_category.h"
#include "df/item.h"
#include "df/items_other_id.h"
#include "df/tool_uses.h"
#include "df/general_ref.h"
#include "df/general_ref_unit_workerst.h"
#include "df/general_ref_unit_holderst.h"
#include "df/general_ref_building_holderst.h"
#include "df/general_ref_contains_itemst.h"
#include "df/general_ref_contained_in_itemst.h"
#include "df/general_ref_contains_unitst.h"
#include "df/itemdef_foodst.h"
#include "df/reaction.h"
#include "df/reaction_reagent_itemst.h"
#include "df/reaction_product_itemst.h"
#include "df/plant_raw.h"
#include "df/inorganic_raw.h"
#include "df/builtin_mats.h"
using std::vector;
using std::string;
@ -984,7 +984,7 @@ static void dryBucket(df::item *item)
for (unsigned i = 0; i < item->itemrefs.size(); i++)
{
df::general_ref *ref = item->itemrefs[i];
if (strict_virtual_cast<df::general_ref_contains_itemst>(ref))
if (ref->getType() == df::general_ref_type::contains_item)
{
df::item *obj = ref->getItem();
@ -1006,20 +1006,20 @@ static bool itemBusy(df::item *item)
for (unsigned i = 0; i < item->itemrefs.size(); i++)
{
df::general_ref *ref = item->itemrefs[i];
if (strict_virtual_cast<df::general_ref_contains_itemst>(ref))
if (ref->getType() == df::general_ref_type::contains_item)
{
df::item *obj = ref->getItem();
if (obj && !obj->flags.bits.garbage_colect)
return true;
}
else if (strict_virtual_cast<df::general_ref_contains_unitst>(ref))
else if (ref->getType() == df::general_ref_type::contains_unit)
return true;
else if (strict_virtual_cast<df::general_ref_unit_holderst>(ref))
else if (ref->getType() == df::general_ref_type::unit_holder)
{
if (!item->flags.bits.in_job)
return true;
}
else if (strict_virtual_cast<df::general_ref_contained_in_itemst>(ref))
else if (ref->getType() == df::general_ref_type::contained_in_item)
{
df::item *obj = ref->getItem();
if (!obj)