src/water_cmd.cpp
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 6507 26c45f253d31
child 9896 2473804114de
--- a/src/water_cmd.cpp	Mon Mar 19 09:33:17 2007 +0000
+++ b/src/water_cmd.cpp	Mon Mar 19 12:38:16 2007 +0000
@@ -212,7 +212,7 @@
 /** Build a piece of canal.
  * @param tile end tile of stretch-dragging
  * @param p1 start tile of stretch-dragging
- * @param p2 ctrl pressed - toggles ocean / canals at sealevel
+ * @param p2 ctrl pressed - toggles ocean / canals at sealevel (ocean only allowed in the scenario editor)
  */
 int32 CmdBuildCanal(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 {
@@ -223,6 +223,8 @@
 	int sx, sy;
 
 	if (p1 >= MapSize()) return CMD_ERROR;
+	/* Outside of the editor you can only build canals, not oceans */
+	if (HASBIT(p2, 0) && _game_mode != GM_EDITOR) return CMD_ERROR;
 
 	x = TileX(tile);
 	y = TileY(tile);
@@ -401,11 +403,11 @@
 	}
 }
 
-typedef struct LocksDrawTileStruct {
+struct LocksDrawTileStruct {
 	int8 delta_x, delta_y, delta_z;
 	byte width, height, depth;
 	SpriteID image;
-} LocksDrawTileStruct;
+};
 
 #include "table/water_land.h"
 
@@ -610,7 +612,7 @@
 	if (!(v->vehstatus & VS_CRASHED)) {
 		uint16 pass = 0;
 
-		if (v->type == VEH_Road) { // flood bus/truck
+		if (v->type == VEH_ROAD) { // flood bus/truck
 			pass = 1; // driver
 			if (v->cargo_type == CT_PASSENGERS)
 				pass += v->cargo_count;
@@ -618,7 +620,7 @@
 			v->vehstatus |= VS_CRASHED;
 			v->u.road.crashed_ctr = 2000; // max 2220, disappear pretty fast
 			RebuildVehicleLists();
-		} else if (v->type == VEH_Train) {
+		} else if (v->type == VEH_TRAIN) {
 			Vehicle *u;
 
 			v = GetFirstVehicleInChain(v);
@@ -727,7 +729,7 @@
 	if (GetWaterTileType(tile) == WATER_TILE_DEPOT) {
 		TileIndex tile2 = GetOtherShipDepotTile(tile);
 
-		ShowDepotWindow(tile < tile2 ? tile : tile2, VEH_Ship);
+		ShowDepotWindow(tile < tile2 ? tile : tile2, VEH_SHIP);
 	}
 }