Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Crash happens on line 670.
This causes a crash because a buoy is a station tile, but it's not a station (it's a waypoint), thus IsStationTile() returns true, but Station::GetByTile() returns nullptr. So you get a null pointer dereference looking up the airport station part location.
Fix would be replacing by something like this, no need to check for IsStationTile() since Station::GetByTile() already checks that:
Station * origin_station = ::Station::GetByTile(origin_tile); if (origin_station != nullptr) origin_tile = origin_st->airport.tile;
There is also a bug in the AI doing this, since it's asking for aircraft distance from a buoy to somewhere else, and aircraft don't use buoys!