mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r2517) - Fix: [pbs] Detect end-of-lines properly regarding depots.
This commit is contained in:
parent
60ddaf95f0
commit
5fb14350a0
8
npf.c
8
npf.c
@ -37,8 +37,8 @@ bool IsEndOfLine(TileIndex tile, Trackdir trackdir)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// depot
|
// depot
|
||||||
if (IsTileDepotType(tile, TRANSPORT_RAIL))
|
if (IsTileDepotType(tile, TRANSPORT_RAIL) && (exitdir != GetDepotDirection(tile, TRANSPORT_RAIL)))
|
||||||
return false;
|
return true;
|
||||||
|
|
||||||
/* Calculate next tile */
|
/* Calculate next tile */
|
||||||
dst_tile = tile + TileOffsByDir(exitdir);
|
dst_tile = tile + TileOffsByDir(exitdir);
|
||||||
@ -51,14 +51,14 @@ bool IsEndOfLine(TileIndex tile, Trackdir trackdir)
|
|||||||
|
|
||||||
{
|
{
|
||||||
byte src_type = GetTileRailType(tile, trackdir);
|
byte src_type = GetTileRailType(tile, trackdir);
|
||||||
byte dst_type = GetTileRailType(dst_tile, TrackdirToExitdir(trackdir));
|
byte dst_type = GetTileRailType(dst_tile, exitdir);
|
||||||
if (src_type != dst_type) {
|
if (src_type != dst_type) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (GetTileOwner(tile) != GetTileOwner(dst_tile))
|
if (GetTileOwner(tile) != GetTileOwner(dst_tile))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (IsTileDepotType(dst_tile, TRANSPORT_RAIL) && (TrackdirToExitdir(trackdir) != ReverseDiagdir(GetDepotDirection(dst_tile, TRANSPORT_RAIL))))
|
if (IsTileDepotType(dst_tile, TRANSPORT_RAIL) && (exitdir != ReverseDiagdir(GetDepotDirection(dst_tile, TRANSPORT_RAIL))))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* Check for oneway signal against us */
|
/* Check for oneway signal against us */
|
||||||
|
Loading…
Reference in New Issue
Block a user