From 3c7d2626e250a4128e2fa1a98f1480e40235ab33 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Sun, 18 Dec 2016 17:57:23 -0600 Subject: [PATCH] df::dfhack_material_category has no constructor, must be manually initialized see #1047 --- plugins/buildingplan-lib.h | 4 +++- plugins/workflow.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/buildingplan-lib.h b/plugins/buildingplan-lib.h index 7ec0c41d4..6975960d2 100644 --- a/plugins/buildingplan-lib.h +++ b/plugins/buildingplan-lib.h @@ -114,7 +114,9 @@ struct ItemFilter bool decorated_only; 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); diff --git a/plugins/workflow.cpp b/plugins/workflow.cpp index 55f1dc504..f8f9e8231 100644 --- a/plugins/workflow.cpp +++ b/plugins/workflow.cpp @@ -357,7 +357,9 @@ public: : 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), 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); } void setGoalCount(int v) { config.ival(0) = v; }