From 2df93a7e8887ee071c32920e899c6c8f95fdf5c4 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 3 Sep 2016 17:30:18 +0000 Subject: [PATCH] Use range_for to iterate choose_drop_segment controlcen check --- similar/main/fireball.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/similar/main/fireball.cpp b/similar/main/fireball.cpp index 0ecf134d4..a80515c55 100644 --- a/similar/main/fireball.cpp +++ b/similar/main/fireball.cpp @@ -567,10 +567,9 @@ static vsegptridx_t choose_drop_segment(playernum_t drop_pnum) segnum = segment_none; } else { //don't drop in any children of control centers - int i; - for (i=0;i<6;i++) { - auto ch = Segments[segnum].children[i]; - if (IS_CHILD(ch) && Segments[ch].special == SEGMENT_IS_CONTROLCEN) { + range_for (auto ch, vcsegptr(segnum)->children) + { + if (IS_CHILD(ch) && vcsegptr(ch)->special == SEGMENT_IS_CONTROLCEN) { segnum = segment_none; break; }