(svn r3777) Add some functions to handle tunnels

This commit is contained in:
tron
2006-03-06 20:55:24 +00:00
parent 49cb8eb470
commit af42610321
11 changed files with 132 additions and 46 deletions

View File

@@ -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;
}