unmovable_cmd.c
changeset 4231 dea6a63dd058
parent 4230 cd86b1c47f33
child 4300 687a17c9c557
--- a/unmovable_cmd.c	Sun Aug 06 08:23:19 2006 +0000
+++ b/unmovable_cmd.c	Sun Aug 06 16:32:49 2006 +0000
@@ -176,12 +176,15 @@
 	}
 }
 
-static uint GetSlopeZ_Unmovable(const TileInfo* ti)
+static uint GetSlopeZ_Unmovable(TileIndex tile, uint x, uint y)
 {
-	if (IsOwnedLand(ti->tile)) {
-		return ti->z + GetPartialZ(ti->x & 0xF, ti->y & 0xF, ti->tileh);
+	if (IsOwnedLand(tile)) {
+		uint z;
+		uint tileh = GetTileSlope(tile, &z);
+
+		return z + GetPartialZ(x & 0xF, y & 0xF, tileh);
 	} else {
-		return ti->z + (ti->tileh == SLOPE_FLAT ? 0 : TILE_HEIGHT);
+		return GetTileMaxZ(tile);
 	}
 }