Changeset - r6974:4cdfedad8a12
[Not reviewed]
master
0 3 0
rubidium - 17 years ago 2007-06-19 21:15:14
rubidium@openttd.org
(svn r10230) -Fix [FS#594]: terraforming wipes out canals. Now you always have to remove the canal before terraforming, instead of "just" removing the canal.
3 files changed with 14 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/clear_cmd.cpp
Show inline comments
 
@@ -22,6 +22,7 @@
 
#include "unmovable_map.h"
 
#include "genworld.h"
 
#include "industry.h"
 
#include "water_map.h"
 

	
 
struct TerraformerHeightMod {
 
	TileIndex tile;
 
@@ -141,6 +142,13 @@ static int TerraformProc(TerraformerStat
 
		}
 
	}
 

	
 
	/* Canals can't be terraformed */
 
	if (IsClearWaterTile(tile) && IsCanal(tile)) {
 
		_terraform_err_tile = tile;
 
		_error_message = STR_MUST_DEMOLISH_CANAL_FIRST;
 
		return -1;
 
	}
 

	
 
	ret = DoCommand(tile, 0, 0, ts->flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR);
 

	
 
	if (CmdFailed(ret)) {
src/lang/english.txt
Show inline comments
 
@@ -1891,6 +1891,7 @@ STR_3804_WATER                          
 
STR_3805_COAST_OR_RIVERBANK                                     :Coast or riverbank
 
STR_3806_SHIP_DEPOT                                             :Ship depot
 
STR_3807_CAN_T_BUILD_ON_WATER                                   :{WHITE}...Can't build on water
 
STR_MUST_DEMOLISH_CANAL_FIRST                                   :{WHITE}Must demolish canal first
 

	
 
##id 0x4000
 
STR_4000_SAVE_GAME                                              :{WHITE}Save Game
src/water_map.h
Show inline comments
 
@@ -45,6 +45,11 @@ static inline bool IsCoast(TileIndex t)
 
	return GetWaterTileType(t) == WATER_TILE_COAST;
 
}
 

	
 
static inline bool IsCanal(TileIndex t)
 
{
 
	return GetWaterTileType(t) == WATER_TILE_CLEAR && GetTileOwner(t) != OWNER_WATER;
 
}
 

	
 
static inline bool IsClearWaterTile(TileIndex t)
 
{
 
	return IsTileType(t, MP_WATER) && IsWater(t) && GetTileSlope(t, NULL) == SLOPE_FLAT;
0 comments (0 inline, 0 general)