tunnelbridge_cmd.c
changeset 1073 4e8f5f9d673d
parent 1067 3ba7987a004e
child 1082 a83d7ac6fecb
equal deleted inserted replaced
1072:74cd9150d473 1073:4e8f5f9d673d
   862 		}
   862 		}
   863 		return _price.build_rail >> 1;
   863 		return _price.build_rail >> 1;
   864 	} else if ((_map5[tile]&0xC6) == 0x80) {
   864 	} else if ((_map5[tile]&0xC6) == 0x80) {
   865 		uint starttile;
   865 		uint starttile;
   866 		int32 cost;
   866 		int32 cost;
       
   867 		uint z = TilePixelHeight(tile);
       
   868 
       
   869 		z += 8;
   867 
   870 
   868 		if (!CheckTileOwnership(tile)) return CMD_ERROR;
   871 		if (!CheckTileOwnership(tile)) return CMD_ERROR;
   869 
   872 
   870 		// railway bridge
   873 		// railway bridge
   871 		starttile = tile = FindEdgesOfBridge(tile, &endtile);
   874 		starttile = tile = FindEdgesOfBridge(tile, &endtile);
   872 		// Make sure there's no vehicle on the bridge
   875 		// Make sure there's no vehicle on the bridge
   873 		if ((v=FindVehicleBetween(tile, endtile, 0xff)) != NULL) {
   876 		if ((v=FindVehicleBetween(tile, endtile, z)) != NULL) {
   874 			VehicleInTheWayErrMsg(v);
   877 			VehicleInTheWayErrMsg(v);
       
   878 			return CMD_ERROR;
       
   879 		}
       
   880 
       
   881 		if (!EnsureNoVehicle(starttile) || !EnsureNoVehicle(endtile)) {
       
   882 			_error_message = STR_8803_TRAIN_IN_THE_WAY;
   875 			return CMD_ERROR;
   883 			return CMD_ERROR;
   876 		}
   884 		}
   877 
   885 
   878 		if ( (uint)(_map3_lo[tile] & 0xF) == totype) return CMD_ERROR;
   886 		if ( (uint)(_map3_lo[tile] & 0xF) == totype) return CMD_ERROR;
   879 		cost = 0;
   887 		cost = 0;