From 362e49c0bc9c0c5cde28e1e9ff3a0ae427e27dd8 Mon Sep 17 00:00:00 2001 From: Nilsolm Date: Sun, 12 Apr 2020 11:02:26 +0200 Subject: [PATCH] autogems: check bin content in linked stockpiles --- plugins/autogems.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/autogems.cpp b/plugins/autogems.cpp index 4121b562f..f22d20d30 100644 --- a/plugins/autogems.cpp +++ b/plugins/autogems.cpp @@ -167,6 +167,16 @@ void create_jobs() { stockpiled.insert(item->id); piled[item->getMaterialIndex()] += 1; } + else if (item->flags.bits.container) { + std::vector binneditems; + Items::getContainedItems(item, &binneditems); + for (df::item *it : binneditems) { + if (valid_gem(it)) { + stockpiled.insert(it->id); + piled[it->getMaterialIndex()] += 1; + } + } + } } // Decrement current jobs from all linked workshops, not just this one.