Skip to content

Commit

Permalink
Added initialRepairDroidGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
Monsterovich authored and past-due committed May 3, 2024
1 parent d631ed3 commit 2a0e824
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cmddroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ bool cmdDroidAddDroid(DROID *psCommander, DROID *psDroid)
ASSERT_OR_RETURN(false, psDroid != nullptr, "psDroid is null?");

auto initialDroidGroup = psDroid->group;
auto initialRepairDroidGroup = psDroid->repairGroup;
// select a value depending on whether the commander was assigned manually or after construction in the factory
auto fallbackDroidGroup = initialDroidGroup != UBYTE_MAX ? initialDroidGroup : psDroid->fallbackGroup;

if (psCommander->psGroup == nullptr)
Expand Down Expand Up @@ -131,6 +133,7 @@ bool cmdDroidAddDroid(DROID *psCommander, DROID *psDroid)
psDroid->fallbackGroup = UBYTE_MAX;
SelectGroupDroid(psDroid);
}
psDroid->repairGroup = initialRepairDroidGroup;
}

if (initialDroidGroup != psDroid->group)
Expand Down

0 comments on commit 2a0e824

Please sign in to comment.