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
[Crash]: NewGRF with multi-tile object causes OpenTTD 12.0-beta2 to crash on map generation #9527
Comments
The error message suggests that the object has tried to be placed on the world border - which is essentially random. Therefore it's entirely possible it's broken in 1.10.2 (and before as well)... If you can narrow down a seed in which this reliably happens, that would be very useful |
Basically just missing bounds checks in the CmdBuildObject function, I would guess. Although, the game seems to display the object's size as 0x0, which might be an artefact of the test grf, or might be something else... EDIT: Aha, thought it felt familiar - see also #8276 |
I haven't been able to replicate this error on older versions. Setting count_per_map256 to 255 will cause OpenTTD 12.0-beta2 to crash pretty much every time, which I guess make sense. Setting it to a lower value makes the error less frequent. Of course, it could still be an error with my nml, but I'm pretty sure that the size is correctly set, and it doesn't explain why the error doesn't apperar in older versions (although there could be something I'm overlooking):
|
Older (released) versions don't have asserts, so that'd be why you don't see any crash - but the object that's partially off the map might cause... issues |
You're right. I've done some more testing, and can indeed replicate the bug in 1.10.2 if I allow objects to be built on the map edge (by setting all edges to Freeform instead of Water). So, the difference seems to be when the bug occurs. 1.10.2 only seems to crash if the the object is actually built, while beta2 crash on the lookup. |
Found the strange issue with the object size in the test grf - the size of the object is actually 0x02 - i.e. one of the dimensions (higher nibble) is 0. The NML looks right, but I don't speak NML/GRF, so I've no idea at what level the issue is being introduced... |
I checked NFO output and it is 0x22 as expected. |
Version of OpenTTD
OpenTTD 12.0-beta2
Steps to reproduce
Build the NewGRF with NML 0.6.0
Start a new game
OpenTTD will crash during map generation
The same NewGRF works properly in OpenTTD 1.10.2.
Upload crash files
crash.zip
multitile_object.zip
The text was updated successfully, but these errors were encountered: