Page 1 of 1
GetPlatformLength returns wrong values for adjacent stations
Posted: 26 Jan 2008 08:34
by Gonozal_VIII
if two stations are built directly next to each other (with ctrl) GetPlatformLength returns the length of both, i noticed that with eddi's middle_stop patch, that lets trains stop in the middle of too long platforms
Re: GetPlatformLength returns wrong values for adjacent stations
Posted: 26 Jan 2008 08:54
by Eddi
i've digged a little into this, most likely cause is this:
Code: Select all
station_map.h:186:
static inline bool IsCompatibleTrainStationTile(TileIndex t1, TileIndex t2)
{
assert(IsRailwayStationTile(t2));
return
IsRailwayStationTile(t1) &&
IsCompatibleRail(GetRailType(t1), GetRailType(t2)) &&
GetRailStationAxis(t1) == GetRailStationAxis(t2) &&
!IsStationTileBlocked(t1);
}
it needs a check wether t1 and t2 belong to the same station
Re: GetPlatformLength returns wrong values for adjacent stations
Posted: 26 Jan 2008 11:32
by peter1138