diff options
author | tron <tron@openttd.org> | 2006-03-06 20:55:24 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-06 20:55:24 +0000 |
commit | f2dc736554c06d69dd936131c4a09ddbc6b58083 (patch) | |
tree | 14ef1d7e7e885dff603aa06189b416a7bd2a6ae0 /town_cmd.c | |
parent | 2d3c28f2b3d24c2b01e54a51e2dcf5ad7f4851c8 (diff) | |
download | openttd-f2dc736554c06d69dd936131c4a09ddbc6b58083.tar.xz |
(svn r3777) Add some functions to handle tunnels
Diffstat (limited to 'town_cmd.c')
-rw-r--r-- | town_cmd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/town_cmd.c b/town_cmd.c index 920601397..9813f5312 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -9,10 +9,10 @@ #include "table/sprites.h" #include "map.h" #include "tile.h" +#include "tunnel_map.h" #include "viewport.h" #include "town.h" #include "command.h" -#include "pathfind.h" #include "gfx.h" #include "industry.h" #include "station.h" @@ -624,9 +624,10 @@ static void GrowTownInTile(TileIndex* tile_ptr, RoadBits mask, int block, Town* int i; // Reached a tunnel? Then continue at the other side of it. - if (IsTileType(tile, MP_TUNNELBRIDGE) && (_m[tile].m5& ~3) == 4) { - FindLengthOfTunnelResult flotr = FindLengthOfTunnel(tile, GB(_m[tile].m5, 0, 2)); - *tile_ptr = flotr.tile; + if (IsTileType(tile, MP_TUNNELBRIDGE) && + GB(_m[tile].m5, 4, 4) == 0 && + GetTunnelTransportType(tile) == TRANSPORT_ROAD) { + *tile_ptr = GetOtherTunnelEnd(tile); return; } |