From ecec61fb4a33e94ee75e85568d57101c664dc7bf Mon Sep 17 00:00:00 2001 From: Nikolay Borodin Date: Sat, 14 Dec 2024 15:06:12 +0200 Subject: [PATCH] Simplify the code and use ModeQueue --- src/structure.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/structure.cpp b/src/structure.cpp index 1073199f95b..108859e0791 100644 --- a/src/structure.cpp +++ b/src/structure.cpp @@ -6234,19 +6234,12 @@ void doNextProduction(STRUCTURE *psStructure, DROID_TEMPLATE *current, QUEUE_MOD { DROID_TEMPLATE *psNextTemplate = factoryProdUpdate(psStructure, current); - if (current) + if (current && current->next) { - auto it = std::find_if(apsTemplateList.begin(), apsTemplateList.end(), [current](const auto &templ) { - return *templ == *current; - }); - - if (it == apsTemplateList.end() && current->next) - { - structSetManufacture(psStructure, current->next, ModeImmediate); - // Increase the production counter, because we produced the old template - factoryProdAdjust(psStructure, current->next, true); - return; - } + structSetManufacture(psStructure, current->next, ModeQueue); + // Increase the production counter, because we produced the old template + factoryProdAdjust(psStructure, current->next, true); + return; } if (psNextTemplate != nullptr)