MCPcopy Create free account
hub / github.com/DFHack/dfhack / non_accepted_storage_item

Function non_accepted_storage_item

plugins/logistics.cpp:480–489  ·  view source on GitHub ↗

quick check for type. this is intended to catch the case of newly empty storage item that happens to still be on the stockpile. we can do a more careful check (e.g. including item quality) if this isn't sufficient

Source from the content-addressed store, hash-verified

478// that happens to still be on the stockpile. we can do a more careful check (e.g. including
479// item quality) if this isn't sufficient
480static bool non_accepted_storage_item(df::building_stockpilest *bld, df::item *item) {
481 auto & flags = bld->settings.flags;
482 if (item->getType() == df::item_type::BIN)
483 return !flags.bits.furniture || !bld->settings.furniture.type[df::furniture_type::BIN];
484 if (item->hasToolUse(df::tool_uses::HEAVY_OBJECT_HAULING))
485 return !flags.bits.furniture || !bld->settings.furniture.type[df::furniture_type::WHEELBARROW];
486 if (item->isFoodStorage())
487 return !flags.bits.furniture || !bld->settings.furniture.type[df::furniture_type::FOOD_STORAGE];
488 return false;
489}
490
491static void scan_stockpile(color_ostream &out, df::building_stockpilest *bld,
492 MeltStockProcessor &melt_stock_processor,

Callers 1

scan_stockpileFunction · 0.85

Calls 1

getTypeMethod · 0.80

Tested by

no test coverage detected