make sure the index is in the array, which isn't necessarily the case,
because a dialog button can get pressed when its callback isn't available any more. Ideally, we would close the dialog or update its buttons when this happens. But this requires bigger changes.
This commit is contained in:
parent
a47725e92f
commit
179e5c587d
1 changed files with 2 additions and 1 deletions
|
@ -264,7 +264,8 @@ void FGATCDialog::PopupCallback(int num) {
|
||||||
//cout << "TOWER " << endl;
|
//cout << "TOWER " << endl;
|
||||||
//cout << "ident is " << atcptr->get_ident() << endl;
|
//cout << "ident is " << atcptr->get_ident() << endl;
|
||||||
atcmentry_vec_type atcmlist = (available_dialog[TOWER])[atcptr->get_ident()];
|
atcmentry_vec_type atcmlist = (available_dialog[TOWER])[atcptr->get_ident()];
|
||||||
if(atcmlist.size()) {
|
unsigned int size = atcmlist.size();
|
||||||
|
if(size && num < size) {
|
||||||
//cout << "Doing callback...\n";
|
//cout << "Doing callback...\n";
|
||||||
ATCMenuEntry a = atcmlist[num];
|
ATCMenuEntry a = atcmlist[num];
|
||||||
atcptr->SetFreqInUse();
|
atcptr->SetFreqInUse();
|
||||||
|
|
Loading…
Reference in a new issue