Hi, testing SynTrans AI I found that it uses SuperLib v27 to manage airports.
When the first Zeppelin is available, it creates Helidepots, then it checks for aircrafts queue using Airport.GetNumAircraftsInAirportQueue function.
Then an "invalid airport type" crash is triggered.
The function cannot manage heli-kind airport types.
I tracked the error back to PAXlink, I think that AI never use Helis, so the error is never seen there.
I found that SynTrans and CluelessPlus are the only AIs that currently use that function, but I never tested CluelessPlus.
Here my patch code to add at line 1057 of airport.nut
Code: Select all
// Patch
case AIAirport.AT_HELIPORT:
holding_rect.AddRectangle(_SuperLib_Tile.GetTileRelative(airport_tile, -2, -4), _SuperLib_Tile.GetTileRelative(airport_tile, 4, 3));
holding_rect.RemoveRectangle(_SuperLib_Tile.GetTileRelative(airport_tile, -1, -2), _SuperLib_Tile.GetTileRelative(airport_tile, 2, 0)); // remove non-holding airport tiles
break;
case AIAirport.AT_HELIDEPOT:
holding_rect.AddRectangle(_SuperLib_Tile.GetTileRelative(airport_tile, -1, -4), _SuperLib_Tile.GetTileRelative(airport_tile, 3, 1));
holding_rect.RemoveRectangle(_SuperLib_Tile.GetTileRelative(airport_tile, 0, -3), _SuperLib_Tile.GetTileRelative(airport_tile, 1, -2)); // remove non-holding airport tiles
break;
case AIAirport.AT_HELISTATION:
holding_rect.AddRectangle(_SuperLib_Tile.GetTileRelative(airport_tile, 0, -2), _SuperLib_Tile.GetTileRelative(airport_tile, 9, 1));
holding_rect.RemoveRectangle(_SuperLib_Tile.GetTileRelative(airport_tile, 0, -2), _SuperLib_Tile.GetTileRelative(airport_tile, 4, -1)); // remove non-holding airport tiles
break;
// End of patch
It still can crash if AIAirport.AT_INVALID goes to default switch, it can happen if an airport has been just destroyed/bulldozed (fault in AI logic, not library)