News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Airport reservation issue

Started by Phystam, February 28, 2018, 11:09:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Phystam

Probably same phenomenon appears in airport.
The aircraft docking at "父島空港" still reserves the runway, so the next aircraft cannot be landing.
The save game data is here: https://simutrans-germany.com/files/upload/ogasawara-issue.sve


jamespetts

Thank you for your report. I have split this from the topic regarding rail reservations, as the airport reservation code is entirely different, and this is therefore almost certainly a different bug.

However, I am afraid that the download link has expired - would you mind uploading the saved game again? I should be most grateful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Phystam

Sorry, I uploaded the save game data on my Dropbox:
https://www.dropbox.com/s/z17xhn65fo20rtt/ogasawara-issue.sve?dl=0
Anyway, this issue could not be seen when I worked on AFHP... Someone changed after that?

jamespetts

#3
Looking at the code, this is unchanged from the time of the AFHP - this does appear to be a possible artefact of that code (and seems to occur only in some conditions, although I have not narrowed this down in any detail).

The problem is that the aircraft does not unreserve the runway when it exits the runway. This ought to occur in the code starting at line 8213 of simvehicle.cc, but, in the cases where this failure exists, the "search_for_stop" variable is set to a very high and apparently incorrect number, so that the first check on that line never evaluates to true, and so the whole code block (including the critical part at line 8135) is never triggered.

What I have not discovered yet is why the incorrect number ends up being stored in search_for_stop. I notice that the AFHP code did alter this to some extent - can you recall anything that you did that might have affected any of this?

Edit: I think that I have fixed this: it appears to have been caused by an integer overflow relating to subtracting an unsigned integer that might overflow past zero. Converting it to a signed integer solved the problem. This issue appears only to have occurred when the runway length was exactly the aircraft's minimum runway length.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Phystam

Oh, thank you for your explaining and fixing the bug.
I confirmed that the bug is now fixed. Thank you again!