changeset 7977:6035dbaf9329 draft

(svn r11533) -Codechange: Rename some unclear clear_x prices member names. While at it, remove one unused entry on the clear_price_table array. It is based on ground type, and the unused one was referencing a non existing one.
author belugas <belugas@openttd.org>
date Tue, 27 Nov 2007 16:02:13 +0000
parents a6e7be9a25c7
children a43897859e38
files src/clear_cmd.cpp src/economy.cpp src/openttd.h src/rail_cmd.cpp src/tree_cmd.cpp src/water_cmd.cpp
diffstat 6 files changed, 20 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/clear_cmd.cpp
+++ b/src/clear_cmd.cpp
@@ -438,20 +438,19 @@
 		MarkTileDirtyByTile(tile);
 	}
 
-	return cost.AddCost(_price.purchase_land * 10);
+	return cost.AddCost(_price.clear_roughland * 10);
 }
 
 
 static CommandCost ClearTile_Clear(TileIndex tile, byte flags)
 {
 	static const Money* clear_price_table[] = {
-		&_price.clear_1,
-		&_price.purchase_land,
-		&_price.clear_2,
-		&_price.clear_3,
-		&_price.purchase_land,
-		&_price.purchase_land,
-		&_price.clear_2, // XXX unused?
+		&_price.clear_grass,
+		&_price.clear_roughland,
+		&_price.clear_rocks,
+		&_price.clear_fields,
+		&_price.clear_roughland,
+		&_price.clear_roughland,
 	};
 	CommandCost price;
 
@@ -484,7 +483,7 @@
 
 	if (flags & DC_EXEC) DoClearSquare(tile);
 
-	return CommandCost(- _price.purchase_land * 2);
+	return CommandCost(- _price.clear_roughland * 2);
 }
 
 
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -791,10 +791,10 @@
 	  65000, ///< ship_base
 	     20, ///< build_trees
 	    250, ///< terraform
-	     20, ///< clear_1
-	     40, ///< purchase_land
-	    200, ///< clear_2
-	    500, ///< clear_3
+	     20, ///< clear_grass
+	     40, ///< clear_roughland
+	    200, ///< clear_rocks
+	    500, ///< clear_fields
 	     20, ///< remove_trees
 	    -70, ///< remove_rail
 	     10, ///< remove_signals
--- a/src/openttd.h
+++ b/src/openttd.h
@@ -242,10 +242,10 @@
 	Money ship_base;
 	Money build_trees;
 	Money terraform;
-	Money clear_1;
-	Money purchase_land;
-	Money clear_2;
-	Money clear_3;
+	Money clear_grass;
+	Money clear_roughland;
+	Money clear_rocks;
+	Money clear_fields;
 	Money remove_trees;
 	Money remove_rail;
 	Money remove_signals;
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -419,7 +419,7 @@
 
 			if (water_ground) {
 				cost.AddCost(-_price.clear_water);
-				cost.AddCost(_price.purchase_land);
+				cost.AddCost(_price.clear_roughland);
 			}
 
 			if (flags & DC_EXEC) {
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -324,8 +324,8 @@
 					}
 
 					switch (GetClearGround(tile)) {
-						case CLEAR_FIELDS: cost.AddCost(_price.clear_3); break;
-						case CLEAR_ROCKS:  cost.AddCost(_price.clear_2); break;
+						case CLEAR_FIELDS: cost.AddCost(_price.clear_fields); break;
+						case CLEAR_ROCKS:  cost.AddCost(_price.clear_rocks); break;
 						default: break;
 					}
 
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -357,7 +357,7 @@
 			if (slope == SLOPE_N || slope == SLOPE_E || slope == SLOPE_S || slope == SLOPE_W) {
 				return CommandCost(_price.clear_water);
 			} else {
-				return CommandCost(_price.purchase_land);
+				return CommandCost(_price.clear_roughland);
 			}
 		}