summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-11-20 00:24:50 +0000
committerfrosch <frosch@openttd.org>2010-11-20 00:24:50 +0000
commitf80af8f8c8c2cbb3ce97d801f45959b855d2abdc (patch)
tree5d9039eabf52b1dde2fbf212e3b4c0835a3de8c1 /src/station_cmd.cpp
parent6fa54473be9a86e913eb9536dda43a39fcf8d423 (diff)
downloadopenttd-f80af8f8c8c2cbb3ce97d801f45959b855d2abdc.tar.xz
(svn r21262) -Fix (r18708)[FS#4246]: Custom station foundations using the 'simple foundations'-method did not draw any sprite for WSE-slopes when there are foundations on both neighboured tiles in the north. As there must be at least one sprite to provide the correct offset for the groundsprite draw the (empty) default foundation sprite in that case.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index fd3f2eab5..dc7665942 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2649,6 +2649,13 @@ static void DrawTile_Station(TileInfo *ti)
if (!HasFoundationNW(ti->tile, slope, z)) ClrBit(parts, 6);
if (!HasFoundationNE(ti->tile, slope, z)) ClrBit(parts, 7);
+ if (parts == 0) {
+ /* We always have to draw at least one sprite to make sure there is a boundingbox and a sprite with the
+ * correct offset for the childsprites.
+ * So, draw the (completely empty) sprite of the default foundations. */
+ goto draw_default_foundation;
+ }
+
StartSpriteCombine();
for (int i = 0; i < 8; i++) {
if (HasBit(parts, i)) {
@@ -2661,6 +2668,7 @@ static void DrawTile_Station(TileInfo *ti)
OffsetGroundSprite(31, 1);
ti->z += ApplyFoundationToSlope(FOUNDATION_LEVELED, &ti->tileh);
} else {
+draw_default_foundation:
DrawFoundation(ti, FOUNDATION_LEVELED);
}
}