Merge remote-tracking branch 'ab9rf/bitfields' into develop

develop
lethosor 2016-12-26 19:40:18 -05:00
commit b034a3747a
3 changed files with 7 additions and 4 deletions

@ -114,7 +114,9 @@ struct ItemFilter
bool decorated_only; bool decorated_only;
ItemFilter() : min_quality(df::item_quality::Ordinary), decorated_only(false), valid(true) ItemFilter() : min_quality(df::item_quality::Ordinary), decorated_only(false), valid(true)
{ } {
clear(); // mat_mask is not cleared by default (see issue #1047)
}
bool matchesMask(DFHack::MaterialInfo &mat); bool matchesMask(DFHack::MaterialInfo &mat);

@ -1135,8 +1135,7 @@ function check_stockpiles(verbose)
if trigger and trigger.divisor then if trigger and trigger.divisor then
local reaction = spec.entry.ints[entry_ints.order_number] local reaction = spec.entry.ints[entry_ints.order_number]
local filled, empty = check_pile(spec.stockpile, verbose) local filled, empty = check_pile(spec.stockpile, verbose)
local amount = trigger.filled and filled or empty local amount = math.floor((trigger.filled and filled or empty) / trigger.divisor)
amount = (amount - (amount % trigger.divisor)) / trigger.divisor
result[reaction] = (result[reaction] or 0) + amount result[reaction] = (result[reaction] or 0) + amount
end end
end end

@ -357,7 +357,9 @@ public:
: is_craft(false), min_quality(item_quality::Ordinary), is_local(false), : is_craft(false), min_quality(item_quality::Ordinary), is_local(false),
weight(0), item_amount(0), item_count(0), item_inuse_amount(0), item_inuse_count(0), weight(0), item_amount(0), item_count(0), item_inuse_amount(0), item_inuse_count(0),
is_active(false), cant_resume_reported(false), low_stock_reported(-1) is_active(false), cant_resume_reported(false), low_stock_reported(-1)
{} {
mat_mask.whole = 0; // see https://github.com/DFHack/dfhack/issues/1047
}
int goalCount() { return config.ival(0); } int goalCount() { return config.ival(0); }
void setGoalCount(int v) { config.ival(0) = v; } void setGoalCount(int v) { config.ival(0) = v; }