mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Fix 77f27e08
: Crash due to incorrect use of AirportSpec::GetIndex
This commit is contained in:
parent
e4bd353d12
commit
89d2cf3a16
@ -539,11 +539,12 @@ public:
|
||||
/* If that fails, select the first available airport
|
||||
* from the first class where airports are available. */
|
||||
for (const auto &cls : AirportClass::Classes()) {
|
||||
for (const auto &as : cls.Specs()) {
|
||||
for (uint i = 0; i < cls.GetSpecCount(); i++) {
|
||||
const AirportSpec *as = cls.GetSpec(i);
|
||||
if (as->IsAvailable()) {
|
||||
_selected_airport_class = cls.Index();
|
||||
this->vscroll->SetCount(cls.GetSpecCount());
|
||||
this->SelectOtherAirport(as->GetIndex());
|
||||
this->SelectOtherAirport(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user