Fix graphic selection dialog for certain types

This prevents problems when the ID of the graphic does not correspond to
its position in the graphics selection dialog.
This commit is contained in:
2017-02-02 11:34:18 -05:00
parent f490464249
commit 583a0ab68b

View File

@@ -229,6 +229,8 @@ pic_num_t choose_graphic(short cur_choice,ePicType g_type,cDialog* parent) {
pic_dlg = new cPictChoice(pics, parent);
break;
}
if(!all_pics.empty())
cur_choice = std::find(all_pics.begin(), all_pics.end(), cur_choice) - all_pics.begin();
if(!pic_dlg) {
if(all_pics.size());
else if(total_pics > 0) {