Skip to content

Commit

Permalink
More improvements to SelectNewDroid
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich committed Mar 11, 2024
1 parent 7598416 commit aa693b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmddroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ bool cmdDroidAddDroid(DROID *psCommander, DROID *psDroid)
{
psDroid->group = fallbackDroidGroup;
psDroid->fallbackGroup = UBYTE_MAX;
// fixme: SelectNewDroid doesn't work here for some reason
SelectNewDroid(psDroid);
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/droid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,7 @@ void droidWasFullyRepairedAny(DROID *psDroid)
{
psDroid->group = psDroid->repairGroup;
psDroid->repairGroup = UBYTE_MAX;
SelectNewDroid(psDroid);
intGroupsChanged(psDroid->group); // update groups UI
}
}
Expand Down Expand Up @@ -3497,6 +3498,11 @@ void SelectNewDroid(DROID *psNewDroid)
std::vector<DROID *> groupDroids;
for (DROID *psDroid : apsDroidLists[psNewDroid->player])
{
// skip itself
if (psDroid == psNewDroid)
{
continue;
}
if (psDroid->group == psNewDroid->group)
{
groupDroids.push_back(psDroid);
Expand Down

0 comments on commit aa693b0

Please sign in to comment.