summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2007-03-04 22:14:32 +0000
committerDarkvater <darkvater@openttd.org>2007-03-04 22:14:32 +0000
commitb3f59814de1a2dd94fcf97e63d33f85c621abe68 (patch)
tree01ab26a3b70ffbe48b2c296ccd0823e7ce0d8d77
parentebe9bd4539b5fcf053b2f1c1e1b04904c8532623 (diff)
downloadopenttd-b3f59814de1a2dd94fcf97e63d33f85c621abe68.tar.xz
(svn r9009) -Fix (r1): Determine whether to play a sound or not when entering a tunnel based on engine type (only steam engines) instead of on spritenum which can be invalid for newgrf trains. DBSet(XL) or any other steam trains without newsounds should sound their horn now.
-rw-r--r--src/tunnelbridge_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 14dfcf154..4b7e49f3c 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -1265,7 +1265,7 @@ static uint32 VehicleEnter_TunnelBridge(Vehicle *v, TileIndex tile, int x, int y
if (v->u.rail.track != TRACK_BIT_WORMHOLE && dir == vdir) {
if (IsFrontEngine(v) && fc == _tunnel_fractcoord_1[dir]) {
- if (!PlayVehicleSound(v, VSE_TUNNEL) && v->spritenum < 4) {
+ if (!PlayVehicleSound(v, VSE_TUNNEL) && RailVehInfo(v->engine_type)->engclass == 0) {
SndPlayVehicleFx(SND_05_TRAIN_THROUGH_TUNNEL, v);
}
return VETSB_CONTINUE;