src/water_cmd.cpp
branchcustombridgeheads
changeset 5650 aefc131bf5ce
parent 5649 55c8267c933f
equal deleted inserted replaced
5649:55c8267c933f 5650:aefc131bf5ce
    81 
    81 
    82 	if (flags & DC_EXEC) {
    82 	if (flags & DC_EXEC) {
    83 		depot->xy = tile;
    83 		depot->xy = tile;
    84 		depot->town_index = ClosestTownFromTile(tile, (uint)-1)->index;
    84 		depot->town_index = ClosestTownFromTile(tile, (uint)-1)->index;
    85 
    85 
    86 		MakeShipDepot(tile,_current_player, DEPOT_NORTH, p1);
    86 		MakeShipDepot(tile, _current_player, DEPOT_NORTH, (Axis)p1);
    87 		MakeShipDepot(tile2,_current_player, DEPOT_SOUTH, p1);
    87 		MakeShipDepot(tile2, _current_player, DEPOT_SOUTH, (Axis)p1);
    88 		MarkTileDirtyByTile(tile);
    88 		MarkTileDirtyByTile(tile);
    89 		MarkTileDirtyByTile(tile2);
    89 		MarkTileDirtyByTile(tile2);
    90 	}
    90 	}
    91 
    91 
    92 	return cost + _price.build_ship_depot;
    92 	return cost + _price.build_ship_depot;
   469 
   469 
   470 
   470 
   471 static uint GetSlopeZ_Water(TileIndex tile, uint x, uint y)
   471 static uint GetSlopeZ_Water(TileIndex tile, uint x, uint y)
   472 {
   472 {
   473 	uint z;
   473 	uint z;
   474 	uint tileh = GetTileSlope(tile, &z);
   474 	Slope tileh = GetTileSlope(tile, &z);
   475 
   475 
   476 	return z + GetPartialZ(x & 0xF, y & 0xF, tileh);
   476 	return z + GetPartialZ(x & 0xF, y & 0xF, tileh);
   477 }
   477 }
   478 
   478 
   479 static Slope GetSlopeTileh_Water(TileIndex tile, Slope tileh)
   479 static Slope GetSlopeTileh_Water(TileIndex tile, Slope tileh)
   671 
   671 
   672 	if (mode != TRANSPORT_WATER) return 0;
   672 	if (mode != TRANSPORT_WATER) return 0;
   673 
   673 
   674 	switch (GetWaterTileType(tile)) {
   674 	switch (GetWaterTileType(tile)) {
   675 		case WATER_CLEAR: ts = TRACK_BIT_ALL; break;
   675 		case WATER_CLEAR: ts = TRACK_BIT_ALL; break;
   676 		case WATER_COAST: ts = coast_tracks[GetTileSlope(tile, NULL) & 0xF]; break;
   676 		case WATER_COAST: ts = (TrackBits)coast_tracks[GetTileSlope(tile, NULL) & 0xF]; break;
   677 		case WATER_LOCK:  ts = AxisToTrackBits(DiagDirToAxis(GetLockDirection(tile))); break;
   677 		case WATER_LOCK:  ts = AxisToTrackBits(DiagDirToAxis(GetLockDirection(tile))); break;
   678 		case WATER_DEPOT: ts = AxisToTrackBits(GetShipDepotAxis(tile)); break;
   678 		case WATER_DEPOT: ts = AxisToTrackBits(GetShipDepotAxis(tile)); break;
   679 		default: return 0;
   679 		default: return 0;
   680 	}
   680 	}
   681 	if (TileX(tile) == 0) {
   681 	if (TileX(tile) == 0) {
   713 {
   713 {
   714 	return 0;
   714 	return 0;
   715 }
   715 }
   716 
   716 
   717 
   717 
   718 const TileTypeProcs _tile_type_water_procs = {
   718 extern const TileTypeProcs _tile_type_water_procs = {
   719 	DrawTile_Water,           /* draw_tile_proc */
   719 	DrawTile_Water,           /* draw_tile_proc */
   720 	GetSlopeZ_Water,          /* get_slope_z_proc */
   720 	GetSlopeZ_Water,          /* get_slope_z_proc */
   721 	ClearTile_Water,          /* clear_tile_proc */
   721 	ClearTile_Water,          /* clear_tile_proc */
   722 	GetAcceptedCargo_Water,   /* get_accepted_cargo_proc */
   722 	GetAcceptedCargo_Water,   /* get_accepted_cargo_proc */
   723 	GetTileDesc_Water,        /* get_tile_desc_proc */
   723 	GetTileDesc_Water,        /* get_tile_desc_proc */