@@ -68,25 +68,25 @@
to_other_tile = ReverseDiagDir(to_other_tile);
TrackBits gtts2 = ::TrackStatusToTrackBits(::GetTileTrackStatus(t2, TRANSPORT_WATER, 0, to_other_tile)) & ::DiagdirReachesTracks(to_other_tile);
return gtts2 != TRACK_BIT_NONE;
}
/* static */ bool AIMarine::BuildWaterDepot(TileIndex tile, TileIndex front)
{
EnforcePrecondition(false, ::IsValidTile(tile));
EnforcePrecondition(false, ::IsValidTile(front));
EnforcePrecondition(false, (::TileX(front) == ::TileX(tile)) != (::TileY(front) == ::TileY(tile)));
return AIObject::DoCommand(tile, ::TileY(front) == ::TileY(tile), 0, CMD_BUILD_SHIP_DEPOT);
return AIObject::DoCommand(tile, ::TileX(front) == ::TileX(tile), 0, CMD_BUILD_SHIP_DEPOT);
/* static */ bool AIMarine::BuildDock(TileIndex tile, StationID station_id)
EnforcePrecondition(false, station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id));
uint p1 = station_id == AIStation::STATION_JOIN_ADJACENT ? 0 : 1;
uint p2 = (AIStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16;
return AIObject::DoCommand(tile, p1, p2, CMD_BUILD_DOCK);
@@ -98,24 +98,25 @@ public:
/**
* Builds a water depot on tile.
* @param tile The tile where the water depot will be build.
* @param front A tile on the same axis with 'tile' as the depot shall be oriented.
* @pre AIMap::IsValidTile(tile).
* @pre AIMap::IsValidTile(front).
* @exception AIError::ERR_AREA_NOT_CLEAR
* @exception AIError::ERR_SITE_UNSUITABLE
* @exception AIMarine::ERR_MARINE_MUST_BE_BUILT_ON_WATER
* @return Whether the water depot has been/can be build or not.
* @note A WaterDepot is 1 tile in width, and 2 tiles in length.
* @note The depot will be built towards the south from 'tile', not necessarily towards 'front'.
*/
static bool BuildWaterDepot(TileIndex tile, TileIndex front);
* Builds a dock where tile is the tile still on land.
* @param tile The tile still on land of the dock.
* @param station_id The station to join, AIStation::STATION_NEW or AIStation::STATION_JOIN_ADJACENT.
* @pre station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id).
* @exception AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
Status change: