From 4c9de793128e6f263529deb2dff3a38748efc6ac Mon Sep 17 00:00:00 2001 From: Nikolay Borodin Date: Sat, 14 Dec 2024 15:12:42 +0200 Subject: [PATCH] Code refactoring --- src/structure.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structure.cpp b/src/structure.cpp index 108859e0791..0510a6045c4 100644 --- a/src/structure.cpp +++ b/src/structure.cpp @@ -6232,8 +6232,6 @@ void releaseProduction(STRUCTURE *psBuilding, QUEUE_MODE mode) void doNextProduction(STRUCTURE *psStructure, DROID_TEMPLATE *current, QUEUE_MODE mode) { - DROID_TEMPLATE *psNextTemplate = factoryProdUpdate(psStructure, current); - if (current && current->next) { structSetManufacture(psStructure, current->next, ModeQueue); @@ -6242,6 +6240,8 @@ void doNextProduction(STRUCTURE *psStructure, DROID_TEMPLATE *current, QUEUE_MOD return; } + DROID_TEMPLATE *psNextTemplate = factoryProdUpdate(psStructure, current); + if (psNextTemplate != nullptr) { structSetManufacture(psStructure, psNextTemplate, ModeQueue); // ModeQueue instead of mode, since production lists aren't currently synchronised.