Skip to content

Commit f9f6da7

Browse files
committed
clang
1 parent a083a89 commit f9f6da7

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

code/missioneditor/common.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@ void reassign_ship_slot(int from, int to, const FredShipSlotConfig& cfg)
228228
// Wing membership: scan every wing and re-point any reference to the old slot.
229229
// (wing.special_ship is wing-relative, NOT a Ships[] index, so it is intentionally
230230
// not touched here.)
231-
for (int w = 0; w < MAX_WINGS; ++w)
231+
for (auto &w: Wings)
232232
{
233-
if (Wings[w].wave_count == 0)
233+
if (w.wave_count == 0)
234234
continue;
235-
for (int k = 0; k < Wings[w].wave_count; ++k)
235+
for (int k = 0; k < w.wave_count; ++k)
236236
{
237-
if (Wings[w].ship_index[k] == from)
238-
Wings[w].ship_index[k] = to;
237+
if (w.ship_index[k] == from)
238+
w.ship_index[k] = to;
239239
}
240240
}
241241

@@ -306,12 +306,12 @@ void reassign_wing_slot(int from, int to, const FredWingSlotConfig& cfg)
306306
}
307307

308308
// Per-ship parent-wing back-reference.
309-
for (int i = 0; i < MAX_SHIPS; ++i)
309+
for (auto &s: Ships)
310310
{
311-
if (Ships[i].objnum < 0)
311+
if (s.objnum < 0)
312312
continue;
313-
if (Ships[i].wingnum == from)
314-
Ships[i].wingnum = to;
313+
if (s.wingnum == from)
314+
s.wingnum = to;
315315
}
316316

317317
// FRED's current-wing pointer, if the caller is tracking one.

0 commit comments

Comments
 (0)