GetPlatformLength returns wrong values for adjacent stations

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Locked
Gonozal_VIII
Traffic Manager
Traffic Manager
Posts: 165
Joined: 03 Dec 2007 15:06

GetPlatformLength returns wrong values for adjacent stations

Post 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
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: GetPlatformLength returns wrong values for adjacent stations

Post 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
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1794
Joined: 30 Mar 2005 09:43

Re: GetPlatformLength returns wrong values for adjacent stations

Post by peter1138 »

He's like, some kind of OpenTTD developer.
Locked

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 16 guests