src/industry_cmd.cpp
branchgamebalance
changeset 9906 6f41b8713b65
parent 9903 dc85aaa556ae
child 9907 3b068c3a1c74
--- a/src/industry_cmd.cpp	Sun Apr 01 09:38:43 2007 +0000
+++ b/src/industry_cmd.cpp	Thu Apr 19 14:43:25 2007 +0000
@@ -12,6 +12,7 @@
 #include "table/sprites.h"
 #include "map.h"
 #include "tile.h"
+#include "landscape.h"
 #include "viewport.h"
 #include "command.h"
 #include "industry.h"
@@ -813,14 +814,14 @@
 	uint field_type;
 	int type;
 
-	if (_opt.landscape == LT_HILLY) {
-		if (GetTileZ(tile) + TILE_HEIGHT * 2 >= _opt.snow_line)
+	if (_opt.landscape == LT_ARCTIC) {
+		if (GetTileZ(tile) + TILE_HEIGHT * 2 >= GetSnowLine())
 			return;
 	}
 
 	/* determine field size */
 	r = (Random() & 0x303) + 0x404;
-	if (_opt.landscape == LT_HILLY) r += 0x404;
+	if (_opt.landscape == LT_ARCTIC) r += 0x404;
 	size_x = GB(r, 0, 8);
 	size_y = GB(r, 8, 8);
 
@@ -851,7 +852,7 @@
 	END_TILE_LOOP(cur_tile, size_x, size_y, tile)
 
 	type = 3;
-	if (_opt.landscape != LT_HILLY && _opt.landscape != LT_DESERT) {
+	if (_opt.landscape != LT_ARCTIC && _opt.landscape != LT_TROPIC) {
 		type = _plantfarmfield_type[Random() & 0xF];
 	}
 
@@ -1015,8 +1016,8 @@
 
 static bool CheckNewIndustry_Forest(TileIndex tile)
 {
-	if (_opt.landscape == LT_HILLY) {
-		if (GetTileZ(tile) < _opt.snow_line + TILE_HEIGHT * 2U) {
+	if (_opt.landscape == LT_ARCTIC) {
+		if (GetTileZ(tile) < HighestSnowLine() + TILE_HEIGHT * 2U) {
 			_error_message = STR_4831_FOREST_CAN_ONLY_BE_PLANTED;
 			return false;
 		}
@@ -1047,8 +1048,8 @@
 
 static bool CheckNewIndustry_Farm(TileIndex tile)
 {
-	if (_opt.landscape == LT_HILLY) {
-		if (GetTileZ(tile) + TILE_HEIGHT * 2 >= _opt.snow_line) {
+	if (_opt.landscape == LT_ARCTIC) {
+		if (GetTileZ(tile) + TILE_HEIGHT * 2 >= HighestSnowLine()) {
 			_error_message = STR_0239_SITE_UNSUITABLE;
 			return false;
 		}
@@ -1765,7 +1766,7 @@
 
 		case INDUSTRYLIFE_PRODUCTION:
 			/* decrease or increase */
-			if (type == IT_OIL_WELL && _opt.landscape == LT_NORMAL)
+			if (type == IT_OIL_WELL && _opt.landscape == LT_TEMPERATE)
 				only_decrease = true;
 
 			if (only_decrease || CHANCE16(1,3)) {