Skip to content

Commit 132818f

Browse files
authored
Merge pull request #4116 from Goober5000/fix_4115
prevent the ship select dialog from crashing if there are too many IFFs
2 parents d24175a + 963e06e commit 132818f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fred2/ship_select.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,12 @@ BOOL ship_select::OnInitDialog()
160160
if (i < (int)Iff_info.size())
161161
{
162162
GetDlgItem(IDC_FILTER_SHIPS_IFF[i])->SetWindowText(Iff_info[i].iff_name);
163+
GetDlgItem(IDC_FILTER_SHIPS_IFF[i])->EnableWindow(m_filter_ships);
163164
}
164165

165166
GetDlgItem(IDC_FILTER_SHIPS_IFF[i])->ShowWindow(i < (int)Iff_info.size());
166167
}
167168

168-
for (i = 0; i < (int)Iff_info.size(); i++)
169-
GetDlgItem(IDC_FILTER_SHIPS_IFF[i])->EnableWindow(m_filter_ships);
170-
171169
wlist_size = wplist_size = 0;
172170
wing_index.clear();
173171
wing_sel_last.clear();

0 commit comments

Comments
 (0)