1
0
Fork 0

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:
mfranz 2006-02-08 17:18:24 +00:00
parent a47725e92f
commit 179e5c587d

View file

@ -264,7 +264,8 @@ void FGATCDialog::PopupCallback(int num) {
//cout << "TOWER " << endl;
//cout << "ident is " << atcptr->get_ident() << endl;
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";
ATCMenuEntry a = atcmlist[num];
atcptr->SetFreqInUse();