src/ai/api/ai_tunnel.cpp
branchnoai
changeset 10691 a60393d87c0b
parent 10679 fcd493243794
child 10977 6c1a6657c7db
equal deleted inserted replaced
10679:fcd493243794 10691:a60393d87c0b
    23 
    23 
    24 	/* If it's a tunnel alread, take the easy way out! */
    24 	/* If it's a tunnel alread, take the easy way out! */
    25 	if (IsTunnelTile(tile)) return ::GetOtherTunnelEnd(tile);
    25 	if (IsTunnelTile(tile)) return ::GetOtherTunnelEnd(tile);
    26 
    26 
    27 	::DoCommand(tile, 0, 0, DC_AUTO, CMD_BUILD_TUNNEL);
    27 	::DoCommand(tile, 0, 0, DC_AUTO, CMD_BUILD_TUNNEL);
    28 	return _build_tunnel_endtile == 0 ? tile : _build_tunnel_endtile;
    28 	return _build_tunnel_endtile == 0 ? INVALID_TILE : _build_tunnel_endtile;
    29 }
    29 }
    30 
    30 
    31 /* static */ bool AITunnel::BuildTunnel(AIVehicle::VehicleType vehicle_type, TileIndex start)
    31 /* static */ bool AITunnel::BuildTunnel(AIVehicle::VehicleType vehicle_type, TileIndex start)
    32 {
    32 {
    33 	EnforcePrecondition(false, ::IsValidTile(start));
    33 	EnforcePrecondition(false, ::IsValidTile(start));