diff --git a/src/group.cpp b/src/group.cpp index 46a0356874e..b3cc2552a5e 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -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 @@ -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 diff --git a/src/hci.cpp b/src/hci.cpp index 8afa0bac89b..5404d51875b 100644 --- a/src/hci.cpp +++ b/src/hci.cpp @@ -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 }