-
-
Notifications
You must be signed in to change notification settings - Fork 957
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
kdtree.hpp crash when Oil Rig is removed #7481
Comments
|
Industry being removed, and a station being removed as a result of that... might be an oil rig station removal. |
A few thoughts on this issue (without actually testing anything, so caveats apply): In ViewportSignKdtreeItem::MakeStation there is the line: The general use of RemapCoords2 appears to be potentially problematic as the kd tree coordinate depends on the GetSlopePixelZ height of the station xy tile, however changes to the height and/or foundation state of this tile do not result in the kd tree being updated. Therefore if GetSlopePixelZ returns different values when the station is added to and removed from the kd tree, an error of the form above could result. |
I can neither reproduce any errors related to oil rig removal nor any to stations where the heights/slopes have changed since construction. |
The crash will only occur if the discrepancy between the element coordinate and the removal coordinate is such that RemoveRecursive looks into the wrong sub-tree when descending. For reference, my fix is here: JGRennison/OpenTTD-patches@070160a, it seems to have stopped the kdtree-related bug reports at my end. |
Version of OpenTTD
Newest Master (OpenTTD 20190406-master-gdef5d99e0e)
Expected result
The game should carry on normally.
Actual result
The game crashes unexpectedly.
Sometimes even, multiple Error windows appear before the game closes itself.
Steps to reproduce
The game will crash with either of the two message after some time:
Log files
crash.png:
crash.log:
hktree.hpp error => crash.log
window.cpp error => crash.log
Crash with multiple error windows => crash.log
The text was updated successfully, but these errors were encountered: