New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.9.3 Crash report #7766
Comments
Offending function: OpenTTD/src/script/api/script_order.cpp Lines 667 to 677 in f664395
Crash happens on line 670. origin_tile is 39971 (0x9C23) and that tile is a buoy.
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! |
Duplicate of #7593 |
Version of OpenTTD
1.9.3
Expected result
Actual result
Steps to reproduce
I set up some NewGRFs downloaded via online content, and ran some AIs. Game started in 1950, but crashed quite early, in 1955.
The Minimal GS is edited.
Minimal GS.zip
crash.zip
The text was updated successfully, but these errors were encountered: