Changeset - r10868:31fe904af100
[Not reviewed]
master
0 1 0
Yexo - 15 years ago 2009-01-22 00:23:37
yexo@openttd.org
(svn r15203) -Fix (r15190): CmdTerraformLand didn't check it's parameters good enough.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/terraform_cmd.cpp
Show inline comments
 
@@ -240,21 +240,21 @@ CommandCost CmdTerraformLand(TileIndex t
 
	ts.modheight_count = ts.tile_table_count = 0;
 

	
 
	/* Compute the costs and the terraforming result in a model of the landscape */
 
	if ((p1 & SLOPE_W) != 0) {
 
	if ((p1 & SLOPE_W) != 0 && tile + TileDiffXY(1, 0) < MapSize()) {
 
		TileIndex t = tile + TileDiffXY(1, 0);
 
		CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
 
		if (CmdFailed(cost)) return cost;
 
		total_cost.AddCost(cost);
 
	}
 

	
 
	if ((p1 & SLOPE_S) != 0) {
 
	if ((p1 & SLOPE_S) != 0 && tile + TileDiffXY(1, 1) < MapSize()) {
 
		TileIndex t = tile + TileDiffXY(1, 1);
 
		CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
 
		if (CmdFailed(cost)) return cost;
 
		total_cost.AddCost(cost);
 
	}
 

	
 
	if ((p1 & SLOPE_E) != 0) {
 
	if ((p1 & SLOPE_E) != 0 && tile + TileDiffXY(0, 1) < MapSize()) {
 
		TileIndex t = tile + TileDiffXY(0, 1);
 
		CommandCost cost = TerraformTileHeight(&ts, t, TileHeight(t) + direction);
 
		if (CmdFailed(cost)) return cost;
0 comments (0 inline, 0 general)