summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-12-11 23:14:35 +0000
committerrubidium <rubidium@openttd.org>2010-12-11 23:14:35 +0000
commit42dc2e63f282b4fed2f15f7f6bf1bebb9eed8e17 (patch)
treefffee6ad896006897d122c5d5d973024da082960 /src/rail_cmd.cpp
parent9bc1e35625fe9e203fc3808283c2af74f0c621db (diff)
downloadopenttd-42dc2e63f282b4fed2f15f7f6bf1bebb9eed8e17.tar.xz
(svn r21473) -Feature [FS#4279]: [NewGRF] Use the station graphics property to determine a fallback for the depot sprites
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r--src/rail_cmd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index ca56de8af..5a502362a 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -2280,8 +2280,8 @@ static void DrawTile_Track(TileInfo *ti)
}
}
- relocation = GetCustomRailSprite(rti, ti->tile, RTSG_DEPOT);
- relocation -= SPR_RAIL_DEPOT_SE_1;
+ int depot_sprite = GetCustomRailSprite(rti, ti->tile, RTSG_DEPOT);
+ relocation = depot_sprite != 0 ? depot_sprite - SPR_RAIL_DEPOT_SE_1 : rti->total_offset;
} else {
/* PBS debugging, draw reserved tracks darker */
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasDepotReservation(ti->tile)) {
@@ -2328,8 +2328,8 @@ void DrawTrainDepotSprite(int x, int y, int dir, RailType railtype)
default: break;
}
- offset = GetCustomRailSprite(rti, INVALID_TILE, RTSG_DEPOT);
- offset -= SPR_RAIL_DEPOT_SE_1;
+ int depot_sprite = GetCustomRailSprite(rti, INVALID_TILE, RTSG_DEPOT);
+ if (depot_sprite != 0) offset = depot_sprite - SPR_RAIL_DEPOT_SE_1;
}
DrawRailTileSeqInGUI(x, y, dts, offset, 0, palette);