add more important checks for matching items

stolen (with love) from advfort.lua
develop
Myk Taylor 2020-10-26 16:54:50 -07:00
parent 100b374af7
commit 1a69a9b483
1 changed files with 7 additions and 0 deletions

@ -704,6 +704,7 @@ static bool matchesFilters(df::item * item,
df::job_item * job_item,
const ItemFilter & item_filter)
{
// check the properties that are not checked by Job::isSuitableItem()
if (job_item->item_type > -1 && job_item->item_type != item->getType())
return false;
@ -711,6 +712,12 @@ static bool matchesFilters(df::item * item,
job_item->item_subtype != item->getSubtype())
return false;
if (job_item->flags2.bits.building_material && !item->isBuildMat())
return false;
if (job_item->metal_ore > -1 && !item->isMetalOre(job_item->metal_ore))
return false;
if (job_item->has_tool_use > df::tool_uses::NONE
&& !item->hasToolUse(job_item->has_tool_use))
return false;