rail_cmd.c
changeset 84 1e0721c29bad
parent 59 fb1a20aefeae
child 149 5f7d4b21df01
--- a/rail_cmd.c	Thu Aug 19 13:39:50 2004 +0000
+++ b/rail_cmd.c	Fri Aug 20 09:32:32 2004 +0000
@@ -203,7 +203,7 @@
 	}
 };
 
-static uint GetRailFoundation(uint tileh, uint bits)
+uint GetRailFoundation(uint tileh, uint bits)
 {
 	int i;
 
@@ -351,7 +351,7 @@
 	cost += ret;
 
 	// the AI is not allowed to used foundationed tiles.
-	if (ret && (_is_ai_player || !_patches.build_on_slopes))
+	if (ret && (!_patches.build_on_slopes || (!_patches.ainew_active && _is_ai_player)))
 		return_cmd_error(STR_1000_LAND_SLOPED_IN_WRONG_DIRECTION);
 
 	if (flags & DC_EXEC && need_clear) {
@@ -628,7 +628,7 @@
 
 	tileh = GetTileSlope(tile, NULL);
 	if (tileh != 0) {
-		if (_is_ai_player || !_patches.build_on_slopes || (tileh & 0x10 || !((0x4C >> p2) & tileh) ))
+		if ((!_patches.ainew_active && _is_ai_player) || !_patches.build_on_slopes || (tileh & 0x10 || !((0x4C >> p2) & tileh) ))
 			return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
 	}