diff --git a/src/structure.cpp b/src/structure.cpp index 522e63ef884..78a678dadfa 100644 --- a/src/structure.cpp +++ b/src/structure.cpp @@ -2487,6 +2487,27 @@ static bool structPlaceDroid(STRUCTURE *psStructure, DROID_TEMPLATE *psTempl, DR { psNewDroid->group = psStructure->productToGroup; intGroupsChanged(psNewDroid->group); // update groups UI + + // if the whole group is selected, add new droids of this group to the selection after production + bool bPutToGroup = true; + for (DROID *psDroid : apsDroidLists[psNewDroid->player]) + { + if (psDroid->group != psNewDroid->group) + { + continue; + } + + if (!psDroid->selected) + { + bPutToGroup = false; + break; + } + } + + if (bPutToGroup) + { + SelectDroid(psNewDroid); + } } setFactorySecondaryState(psNewDroid, psStructure); const auto mapCoord = map_coord({x, y});