(svn r13090) -Codechange: add functions for direct conversion from DiagDirection to Track and Trackbits

This commit is contained in:
smatz
2008-05-14 18:31:21 +00:00
parent c90cda6c1c
commit 2be223fc03
12 changed files with 63 additions and 32 deletions

View File

@@ -88,7 +88,7 @@ public:
if (v->current_order.IsType(OT_GOTO_STATION) && tile == v->dest_tile) break;
// stop if we have just entered the depot
if (IsRoadDepotTile(tile) && trackdir == DiagdirToDiagTrackdir(ReverseDiagDir(GetRoadDepotDirection(tile)))) {
if (IsRoadDepotTile(tile) && trackdir == DiagDirToDiagTrackdir(ReverseDiagDir(GetRoadDepotDirection(tile)))) {
// next time we will reverse and leave the depot
break;
}
@@ -264,7 +264,7 @@ public:
// handle special case - when next tile is destination tile
if (tile == v->dest_tile) {
// choose diagonal trackdir reachable from enterdir
return (Trackdir)DiagdirToDiagTrackdir(enterdir);
return DiagDirToDiagTrackdir(enterdir);
}
// our source tile will be the next vehicle tile (should be the given one)
TileIndex src_tile = tile;