mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-25 08:22:17 +00:00
Change: distinguish between 'Flat land required' and 'Land sloped in wrong direction' for building depots
This commit is contained in:
+2
-7
@@ -956,9 +956,6 @@ CommandCost CmdRemoveRailroadTrack(DoCommandFlags flags, TileIndex end_tile, Til
|
||||
* @param railtype rail type
|
||||
* @param dir entrance direction
|
||||
* @return the cost of this operation or an error
|
||||
*
|
||||
* @todo When checking for the tile slope,
|
||||
* distinguish between "Flat land required" and "land sloped in wrong direction"
|
||||
*/
|
||||
CommandCost CmdBuildTrainDepot(DoCommandFlags flags, TileIndex tile, RailType railtype, DiagDirection dir)
|
||||
{
|
||||
@@ -977,9 +974,8 @@ CommandCost CmdBuildTrainDepot(DoCommandFlags flags, TileIndex tile, RailType ra
|
||||
*/
|
||||
|
||||
if (tileh != SLOPE_FLAT) {
|
||||
if (!_settings_game.construction.build_on_slopes || !CanBuildDepotByTileh(dir, tileh)) {
|
||||
return CommandCost(STR_ERROR_FLAT_LAND_REQUIRED);
|
||||
}
|
||||
if (!_settings_game.construction.build_on_slopes) return CommandCost(STR_ERROR_FLAT_LAND_REQUIRED);
|
||||
if (!CanBuildDepotByTileh(dir, tileh)) return CommandCost(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
|
||||
cost.AddCost(_price[Price::BuildFoundation]);
|
||||
}
|
||||
|
||||
@@ -1046,7 +1042,6 @@ CommandCost CmdBuildTrainDepot(DoCommandFlags flags, TileIndex tile, RailType ra
|
||||
* @param skip_existing_signals true = don't modify an existing signal but don't fail either, false = always set new signal type
|
||||
* @param signals_copy used for CmdBuildManySignals() to copy direction of first signal
|
||||
* @return the cost of this operation or an error
|
||||
* @todo p2 should be replaced by two bits for "along" and "against" the track.
|
||||
*/
|
||||
CommandCost CmdBuildSingleSignal(DoCommandFlags flags, TileIndex tile, Track track, SignalType sigtype, SignalVariant sigvar, bool convert_signal, bool skip_existing_signals, bool ctrl_pressed, SignalType cycle_start, SignalType cycle_stop, uint8_t num_dir_cycle, uint8_t signals_copy)
|
||||
{
|
||||
|
||||
+2
-6
@@ -1134,9 +1134,6 @@ std::tuple<CommandCost, Money> CmdRemoveLongRoad(DoCommandFlags flags, TileIndex
|
||||
* @param rt road type
|
||||
* @param dir entrance direction
|
||||
* @return the cost of this operation or an error
|
||||
*
|
||||
* @todo When checking for the tile slope,
|
||||
* distinguish between "Flat land required" and "land sloped in wrong direction"
|
||||
*/
|
||||
CommandCost CmdBuildRoadDepot(DoCommandFlags flags, TileIndex tile, RoadType rt, DiagDirection dir)
|
||||
{
|
||||
@@ -1146,9 +1143,8 @@ CommandCost CmdBuildRoadDepot(DoCommandFlags flags, TileIndex tile, RoadType rt,
|
||||
|
||||
Slope tileh = GetTileSlope(tile);
|
||||
if (tileh != SLOPE_FLAT) {
|
||||
if (!_settings_game.construction.build_on_slopes || !CanBuildDepotByTileh(dir, tileh)) {
|
||||
return CommandCost(STR_ERROR_FLAT_LAND_REQUIRED);
|
||||
}
|
||||
if (!_settings_game.construction.build_on_slopes) return CommandCost(STR_ERROR_FLAT_LAND_REQUIRED);
|
||||
if (!CanBuildDepotByTileh(dir, tileh)) return CommandCost(STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION);
|
||||
cost.AddCost(_price[Price::BuildFoundation]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user