|
@@ -310,25 +310,25 @@ CommandCost CmdBuildRailWaypoint(TileInd
|
|
|
HasBit(GetRailReservationTrackBits(tile), AxisToTrack(axis)) :
|
|
|
HasStationReservation(tile);
|
|
|
MakeRailWaypoint(tile, wp->owner, wp->index, axis, layout_ptr[i], GetRailType(tile));
|
|
|
SetCustomStationSpecIndex(tile, map_spec_index);
|
|
|
SetRailStationReservation(tile, reserved);
|
|
|
MarkTileDirtyByTile(tile);
|
|
|
|
|
|
DeallocateSpecFromStation(wp, old_specindex);
|
|
|
YapfNotifyTrackLayoutChange(tile, AxisToTrack(axis));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return CommandCost(EXPENSES_CONSTRUCTION, count * _price[PR_BUILD_DEPOT_TRAIN]);
|
|
|
return CommandCost(EXPENSES_CONSTRUCTION, count * _price[PR_BUILD_WAYPOINT_RAIL]);
|
|
|
}
|
|
|
|
|
|
/** Build a buoy.
|
|
|
* @param tile tile where to place the bouy
|
|
|
* @param flags operation to perform
|
|
|
* @param p1 unused
|
|
|
* @param p2 unused
|
|
|
* @param text unused
|
|
|
* @return the cost of this operation or an error
|
|
|
*/
|
|
|
CommandCost CmdBuildBuoy(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
|
|
{
|
|
@@ -357,25 +357,25 @@ CommandCost CmdBuildBuoy(TileIndex tile,
|
|
|
wp->owner = OWNER_NONE;
|
|
|
|
|
|
wp->build_date = _date;
|
|
|
|
|
|
if (wp->town == NULL) MakeDefaultWaypointName(wp);
|
|
|
|
|
|
MakeBuoy(tile, wp->index, GetWaterClass(tile));
|
|
|
|
|
|
wp->UpdateVirtCoord();
|
|
|
InvalidateWindowData(WC_WAYPOINT_VIEW, wp->index);
|
|
|
}
|
|
|
|
|
|
return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_STATION_DOCK]);
|
|
|
return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_WAYPOINT_BUOY]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Remove a buoy
|
|
|
* @param tile TileIndex been queried
|
|
|
* @param flags operation to perform
|
|
|
* @pre IsBuoyTile(tile)
|
|
|
* @return cost or failure of operation
|
|
|
*/
|
|
|
CommandCost RemoveBuoy(TileIndex tile, DoCommandFlag flags)
|
|
|
{
|
|
|
/* XXX: strange stuff, allow clearing as invalid company when clearing landscape */
|
|
@@ -395,25 +395,25 @@ CommandCost RemoveBuoy(TileIndex tile, D
|
|
|
/* We have to set the water tile's state to the same state as before the
|
|
|
* buoy was placed. Otherwise one could plant a buoy on a canal edge,
|
|
|
* remove it and flood the land (if the canal edge is at level 0) */
|
|
|
MakeWaterKeepingClass(tile, GetTileOwner(tile));
|
|
|
MarkTileDirtyByTile(tile);
|
|
|
|
|
|
wp->rect.AfterRemoveTile(wp, tile);
|
|
|
|
|
|
wp->UpdateVirtCoord();
|
|
|
wp->delete_ctr = 0;
|
|
|
}
|
|
|
|
|
|
return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_STATION_TRUCK]);
|
|
|
return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_WAYPOINT_BUOY]);
|
|
|
}
|
|
|
|
|
|
|
|
|
static bool IsUniqueWaypointName(const char *name)
|
|
|
{
|
|
|
const Waypoint *wp;
|
|
|
|
|
|
FOR_ALL_WAYPOINTS(wp) {
|
|
|
if (wp->name != NULL && strcmp(wp->name, name) == 0) return false;
|
|
|
}
|
|
|
|
|
|
return true;
|