(svn r11069) -Codechange: allow slopes under statues. Patch by kaan.
authorrubidium
Sun, 09 Sep 2007 11:30:44 +0000
changeset 7549 53483e249123
parent 7548 3a679b6e8b30
child 7550 dc1fcce38fb8
(svn r11069) -Codechange: allow slopes under statues. Patch by kaan.
src/town_cmd.cpp
src/unmovable_cmd.cpp
--- a/src/town_cmd.cpp	Sun Sep 09 11:23:49 2007 +0000
+++ b/src/town_cmd.cpp	Sun Sep 09 11:30:44 2007 +0000
@@ -1928,7 +1928,8 @@
 	PlayerID old;
 	CommandCost r;
 
-	if (GetTileSlope(tile, NULL) != SLOPE_FLAT) return false;
+	/* Statues can be build on slopes, just like houses. Only the steep slopes is a no go. */
+	if (IsSteepSlope(GetTileSlope(tile, NULL))) return false;
 
 	if (!IsTileType(tile, MP_HOUSE) &&
 			!IsTileType(tile, MP_CLEAR) &&
--- a/src/unmovable_cmd.cpp	Sun Sep 09 11:23:49 2007 +0000
+++ b/src/unmovable_cmd.cpp	Sun Sep 09 11:30:44 2007 +0000
@@ -110,6 +110,8 @@
 	return cost;
 }
 
+static Foundation GetFoundation_Unmovable(TileIndex tile, Slope tileh);
+
 static void DrawTile_Unmovable(TileInfo *ti)
 {
 
@@ -132,6 +134,9 @@
 		}
 
 		case UNMOVABLE_STATUE:
+			/* This should prevent statues from sinking into the ground when on a slope. */
+			if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, GetFoundation_Unmovable(ti->tile, ti->tileh));
+
 			DrawGroundSprite(SPR_CONCRETE_GROUND, PAL_NONE);
 
 			AddSortableSpriteToDraw(SPR_STATUE_COMPANY, PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)), ti->x, ti->y, 16, 16, 25, ti->z, HASBIT(_transparent_opt, TO_STRUCTURES));