summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2020-02-09 20:24:56 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2020-02-10 00:17:50 +0100
commit45838d0105eaa569ed27b62452d21621b61c4bf0 (patch)
tree953c04d8c25b481eb1168d6aa423bf0d6376a79b /src
parent9e4eee1b9e348841dbf306547dda2c560cd7f851 (diff)
downloadopenttd-45838d0105eaa569ed27b62452d21621b61c4bf0.tar.xz
Fix #7958: Use NewGRF provided catenary sprites when either front or back is overridden
Diffstat (limited to 'src')
-rw-r--r--src/tunnelbridge_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 6a803cca7..c5e2f8d9b 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -1121,12 +1121,12 @@ static void GetBridgeRoadCatenary(const RoadTypeInfo *rti, TileIndex head_tile,
/* Simplified from DrawRoadTypeCatenary() to remove all the special cases required for regular ground road */
spr_back = GetCustomRoadSprite(rti, head_tile, ROTSG_CATENARY_BACK, head ? TCX_NORMAL : TCX_ON_BRIDGE);
spr_front = GetCustomRoadSprite(rti, head_tile, ROTSG_CATENARY_FRONT, head ? TCX_NORMAL : TCX_ON_BRIDGE);
- if (spr_back == 0 || spr_front == 0) {
+ if (spr_back == 0 && spr_front == 0) {
spr_back = SPR_TRAMWAY_BASE + back_offsets[offset];
spr_front = SPR_TRAMWAY_BASE + front_offsets[offset];
} else {
- spr_back += 23 + offset;
- spr_front += 23 + offset;
+ if (spr_back != 0) spr_back += 23 + offset;
+ if (spr_front != 0) spr_front += 23 + offset;
}
}