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
Game crash from out-of-bounds helicopter, infinite circling with superfast aircraft #7619
Version of OpenTTD
Game does not crash and both aircraft land properly.
A. When you repeatedly start/stop any helicopter under certain conditions (such as below), the game can crash with
B. When a regular aircraft (such as the Arwing) that is going very fast (>4000 km/h) tries to land in an airport, it circles around the destination airport infinitely. This has the following effects:
Steps to reproduce
This should really be separate issues, but whatever
First issue is crashing the game due to trying to render the error message ("aircraft cannot be stopped") at an invalid tile:
Note the y value of 16777296 for ShowErrorMessage. This is due to the vehicle's tile being invalid and outside of the range of the map, caused by the intercontinental airport's holding pattern being as wide as it is. I don't think it's distinct to helicopters, but I've been unable to reproduce with standard aircraft. Something to do with the circling pattern, perhaps?
Not sure whether the best course of action to fix that would be - it's not enough just to add some clamps to ShowErrorMessage, as the vehicle's position is invalid - it will just cause other issues later on (e.g. when saving). Could perhaps adjust the intercontinental airport's holding pattern?
The other issue is similarly niche. It only seems to happen when the aircraft approaches from certain directions - from the north east doesn't seem to trigger it, but from the south west (and presumably north west as per original report) does. Adding some print statements in indicates that the aircraft is stuck in movement data index "19" (for city airport) and just never leaves it. Presumably it's just going fast enough to go "past" the end of the pattern and being forced to begin it again? This requires further debugging though