(svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.

This commit is contained in:
celestar
2006-03-29 16:30:26 +00:00
parent 9c96bcb997
commit a7d8ad0004
42 changed files with 2258 additions and 122 deletions

View File

@@ -454,7 +454,8 @@ typedef struct {
void *userdata;
TileIndex dest;
byte tracktype;
TransportType tracktype;
RailTypeMask railtypes;
uint maxlength;
HashLink *new_link;
@@ -791,6 +792,11 @@ start_at:
* bits, not just reachable ones, to prevent infinite loops. */
if (bits == 0 || TracksOverlap(allbits)) break;
if (!HASBIT(tpf->railtypes, GetRailType(tile))) {
bits = 0;
break;
}
/* If we reach here, the tile has exactly one track, and this
track is reachable => Rail segment continues */
@@ -926,14 +932,15 @@ start_at:
// new pathfinder for trains. better and faster.
void NewTrainPathfind(TileIndex tile, TileIndex dest, DiagDirection direction, NTPEnumProc* enum_proc, void* data)
void NewTrainPathfind(TileIndex tile, TileIndex dest, RailTypeMask railtypes, DiagDirection direction, NTPEnumProc* enum_proc, void* data)
{
NewTrackPathFinder tpf;
tpf.dest = dest;
tpf.userdata = data;
tpf.enum_proc = enum_proc;
tpf.tracktype = 0;
tpf.tracktype = TRANSPORT_RAIL;
tpf.railtypes = railtypes;
tpf.maxlength = min(_patches.pf_maxlength * 3, 10000);
tpf.nstack = 0;
tpf.new_link = tpf.links;