Skip to content

Commit

Permalink
Groups UI: Update when transporter groups change
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Aug 29, 2023
1 parent 39d873d commit fc904e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions src/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,7 @@ void DROID_GROUP::add(DROID *psDroid)
}
}

if (type == GT_COMMAND && psCommander)
{
intCommanderGroupChanged(psCommander);
}
intCommanderGroupChanged((type == GT_COMMAND && psCommander) ? psCommander : nullptr);
}

// remove a droid from a group
Expand Down Expand Up @@ -229,10 +226,7 @@ void DROID_GROUP::remove(DROID *psDroid)
delete this;
}

if (type == GT_COMMAND && psCommander)
{
intCommanderGroupChanged(psCommander);
}
intCommanderGroupChanged((type == GT_COMMAND && psCommander) ? psCommander : nullptr);
}

// count the members of a group
Expand Down
2 changes: 1 addition & 1 deletion src/hci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2044,7 +2044,7 @@ void intGroupDamaged(UBYTE group, uint64_t additionalDamage, bool unitKilled)
}
}

void intCommanderGroupChanged(const DROID *psCommander)
void intCommanderGroupChanged(const DROID *psCommander) // psCommander may be null!
{
intGroupsChanged(); // just trigger full group change event
}
Expand Down

0 comments on commit fc904e5

Please sign in to comment.