@@ -128,12 +128,13 @@ static void TPFMode2(TrackPathFinder *tp
{
uint bits;
int i;
RememberData rd;
int owner = -1;
/* XXX: Mode 2 is currently only used for ships, why is this code here? */
if (tpf->tracktype == TRANSPORT_RAIL) {
if (IsTileType(tile, MP_RAILWAY) || IsTileType(tile, MP_STATION) || IsTileType(tile, MP_TUNNELBRIDGE)) {
owner = GetTileOwner(tile);
/* Check if we are on the middle of a bridge (has no owner) */
if (IsTileType(tile, MP_TUNNELBRIDGE) && (_map5[tile] & 0xC0) == 0xC0)
owner = -1;
@@ -337,12 +338,16 @@ static void TPFMode1(TrackPathFinder *tp
/* the next is only used when signals are checked.
* seems to go in 2 directions simultaneously */
/* if i can get rid of this, tail end recursion can be used to minimize
* stack space dramatically. */
/* If we are doing signal setting, we must reverse at evere tile, so we
* iterate all the tracks in a signal block, even when a normal train would
* not reach it (for example, when two lines merge */
if (tpf->hasbit_13)
return;
tile = tile_org;
direction ^= 2;