Skip to content

Commit

Permalink
Renamed function.
Browse files Browse the repository at this point in the history
  • Loading branch information
klei1984 committed Nov 9, 2024
1 parent f1c24a0 commit 6954cb8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/access.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ UnitInfo* Access_SeekNextUnit(uint16_t team, UnitInfo* unit, bool seek_direction
return result;
}

bool Access_IsChildOfUnitInList(UnitInfo* unit, SmartList<UnitInfo>* list, SmartList<UnitInfo>::Iterator* it) {
bool Access_IsHeldByUnit(UnitInfo* unit, SmartList<UnitInfo>* list, SmartList<UnitInfo>::Iterator* it) {
for (; *it != list->End(); ++*it) {
if ((*(*it)).GetOrder() == ORDER_IDLE && (*(*it)).GetParent() == unit) {
break;
Expand Down
2 changes: 1 addition & 1 deletion src/access.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ UnitInfo *Access_GetFirstMiningStation(uint16_t team);
UnitInfo *Access_GetFirstActiveUnit(uint16_t team, SmartList<UnitInfo> &units);
bool Access_IsWithinMovementRange(UnitInfo *unit);
UnitInfo *Access_SeekNextUnit(uint16_t team, UnitInfo *unit, bool seek_direction);
bool Access_IsChildOfUnitInList(UnitInfo *unit, SmartList<UnitInfo> *list, SmartList<UnitInfo>::Iterator *it);
bool Access_IsHeldByUnit(UnitInfo *unit, SmartList<UnitInfo> *list, SmartList<UnitInfo>::Iterator *it);
void Access_RenewAttackOrders(SmartList<UnitInfo> &units, uint16_t team);
void Access_GroupAttackOrder(UnitInfo *unit, bool mode);
int32_t Access_GetStoredUnitCount(UnitInfo *unit);
Expand Down
4 changes: 2 additions & 2 deletions src/repairshopmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,13 @@ RepairShopMenu::RepairShopMenu(UnitInfo *unit)

if (unit->GetUnitType() == HANGAR) {
for (SmartList<UnitInfo>::Iterator it = UnitsManager_MobileAirUnits.Begin();
Access_IsChildOfUnitInList(unit, &UnitsManager_MobileAirUnits, &it); ++it) {
Access_IsHeldByUnit(unit, &UnitsManager_MobileAirUnits, &it); ++it) {
units.PushBack(*it);
}

} else {
for (SmartList<UnitInfo>::Iterator it = UnitsManager_MobileLandSeaUnits.Begin();
Access_IsChildOfUnitInList(unit, &UnitsManager_MobileLandSeaUnits, &it); ++it) {
Access_IsHeldByUnit(unit, &UnitsManager_MobileLandSeaUnits, &it); ++it) {
units.PushBack(*it);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/units_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5622,11 +5622,11 @@ void UnitsManager_BuildClearing(UnitInfo* unit, bool mode) {
units = &UnitsManager_MobileLandSeaUnits;
}

for (SmartList<UnitInfo>::Iterator it = units->Begin(); Access_IsChildOfUnitInList(unit, units, &it);
for (SmartList<UnitInfo>::Iterator it = units->Begin(); Access_IsHeldByUnit(unit, units, &it);
UnitsManager_DestroyUnit(it->Get())) {
if ((*it).GetUnitType() == SEATRANS || (*it).GetUnitType() == AIRTRANS || (*it).GetUnitType() == CLNTRANS) {
for (SmartList<UnitInfo>::Iterator it2 = UnitsManager_MobileLandSeaUnits.Begin();
Access_IsChildOfUnitInList(it->Get(), &UnitsManager_MobileLandSeaUnits, &it2);
Access_IsHeldByUnit(it->Get(), &UnitsManager_MobileLandSeaUnits, &it2);
UnitsManager_DestroyUnit(it2->Get())) {
++UnitsManager_TeamInfo[(*it2).team].casualties[(*it2).GetUnitType()];
}
Expand Down

0 comments on commit 6954cb8

Please sign in to comment.