OpenTTD

Tasklist

FS#86 - Crash while watching airport with many (IsBuoy_(t))

Attached to Project: OpenTTD
Opened by FrankW (FrankW) - Tuesday, 28 March 2006, 18:08 GMT
Last edited by Celestar (Celestar) - Thursday, 11 May 2006, 05:48 GMT
Type Bug
Category Core
Status Closed
Assigned To Celestar (Celestar)
Operating System All
Severity High
Priority Immediate
Reported Version trunk
Due in Version 0.4.8
Due Date 2006-03-29
Percent Complete 100%
Votes 0
Private No

Details

To reproduce:
1. Open attached save game
2. Go to "Frunpool Flughafen" (should already be centered when opening the game)
3. Wait a bit, it should not take long to crash

Results:
Assertion in station_map.c, Expression IsBuoy_(t)
If assertion is ignored, Assertion title < MapSize() follows, then another assertion and then it crashes.
I think this bug was not present in a somewhat older nightly.
This task depends upon

Closed by  Celestar (Celestar)
Thursday, 11 May 2006, 05:48 GMT
Reason for closing:  Fixed
Comment by FrankW (FrankW) - Tuesday, 28 March 2006, 18:44 GMT
Seems like this is a regression, this broke between r4109 and r4115.
BTW: The last assertion i get is IsTileType(t, MP_STATION) (for the "then another assertion" in the bug report itself).
Comment by Darkvater (Darkvater) - Tuesday, 28 March 2006, 21:11 GMT
Indeed, the GetStationType() screws up for the helipads. The old code says:
(str=STR_3060_AIRPORT, m5 < 0x43 || (m5 >= 83 && m5 <= 114)) ||

But the new code says:
IS_INT_INSIDE(_m[t].m5, AIRPORT_BASE, AIRPORT_BASE + AIRPORT_SIZE) ||
IS_INT_INSIDE(_m[t].m5, AIRPORT_BASE_EXTENDED, AIRPORT_BASE_EXTENDED + AIRPORT_SIZE_EXTENDED);

which is [8, 67) || [83, 114). IS_INT_INSIDE is NOT inclusive the last element os in essence it is m5>=83 && m5<114, different from the old code. Perhaps a +1 at the end? I would look at station_map.h again double-checking everything because according to the old code HANGAR0=32, HANGAR1=45, but in the new HANGAR0=32, HANGAR=65. I think that is wrong as well.

Loading...