Changeset - r16968:933763f88261
[Not reviewed]
master
0 1 0
rubidium - 13 years ago 2011-01-04 20:33:22
rubidium@openttd.org
(svn r21714) -Codechange: unduplicate a bit of code path
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/landscape.cpp
Show inline comments
 
@@ -620,28 +620,28 @@ CommandCost CmdLandscapeClear(TileIndex 
 

	
 
	/* If this tile was the first tile which caused object destruction, always
 
	 * pass it on to the tile_type_proc. That way multiple test runs and the exec run stay consistent. */
 
	if (coa != NULL && coa->first_tile != tile) {
 
		/* If this tile belongs to an object which was already cleared via another tile, pretend it has been
 
		 * already removed.
 
		 * However, we need to check stuff, which is not the same for all object tiles. (e.g. being on water or not) */
 

	
 
		/* If a object is removed, it leaves either bare land or water. */
 
		if ((flags & DC_NO_WATER) && HasTileWaterClass(tile) && IsTileOnWater(tile)) {
 
			return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
 
		}
 
		if (do_clear && (flags & DC_EXEC)) DoClearSquare(tile);
 
		return cost;
 
	} else {
 
		cost.AddCost(_tile_type_procs[GetTileType(tile)]->clear_tile_proc(tile, flags));
 
	}
 
	cost.AddCost(_tile_type_procs[GetTileType(tile)]->clear_tile_proc(tile, flags));
 

	
 
	if (do_clear && (flags & DC_EXEC)) DoClearSquare(tile);
 
	return cost;
 
}
 

	
 
/**
 
 * Clear a big piece of landscape
 
 * @param tile end tile of area dragging
 
 * @param flags of operation to conduct
 
 * @param p1 start tile of area dragging
 
 * @param p2 various bitstuffed data.
 
 *  bit      0: Whether to use the Orthogonal (0) or Diagonal (1) iterator.
 
 * @param text unused
0 comments (0 inline, 0 general)