Skip to content

Commit

Permalink
Code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich committed Dec 14, 2024
1 parent ecec61f commit 20f3cbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/structure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.
Expand Down Expand Up @@ -6340,7 +6340,7 @@ void factoryProdAdjust(STRUCTURE *psStructure, DROID_TEMPLATE *psTemplate, bool
// save new template into the old one
if (psFactory->psSubject && *psFactory->psSubject != *psTemplate)
{
auto it = std::find_if(apsTemplateList.begin(), apsTemplateList.end(), [psFactory](const auto &templ) {
auto it = std::find_if(apsTemplateList.begin(), apsTemplateList.end(), [psFactory](const DROID_TEMPLATE *templ) {
return *templ == *psFactory->psSubject;
});

Expand Down

0 comments on commit 20f3cbc

Please sign in to comment.