summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-05-06 14:57:42 +0000
committerfrosch <frosch@openttd.org>2013-05-06 14:57:42 +0000
commit9dee2f5c1e013c2e4914eb6203d5d56990d889a8 (patch)
treeb40c07a3a5d36459b787fd84106de38655917399
parent2030d1cf60e69461db0c7187a11cd19ac6e7f019 (diff)
downloadopenttd-9dee2f5c1e013c2e4914eb6203d5d56990d889a8.tar.xz
(svn r25225) -Fix: [NewGRF] Play vehicle sound effect also for planes.
-rw-r--r--src/vehicle.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index adea79f86..de5b89ced 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -890,9 +890,23 @@ void CallVehicleTicks()
}
}
- if (v->type == VEH_TRAIN && Train::From(v)->IsWagon()) continue;
- if (v->type == VEH_AIRCRAFT && v->subtype != AIR_HELICOPTER) continue;
- if (v->type == VEH_ROAD && !RoadVehicle::From(v)->IsFrontEngine()) continue;
+ /* Check vehicle sounds */
+ switch (v->type) {
+ case VEH_TRAIN:
+ if (Train::From(v)->IsWagon()) continue;
+ break;
+
+ case VEH_ROAD:
+ if (!RoadVehicle::From(v)->IsFrontEngine()) continue;
+ break;
+
+ case VEH_AIRCRAFT:
+ if (!Aircraft::From(v)->IsNormalAircraft()) continue;
+ break;
+
+ default:
+ break;
+ }
v->motion_counter += front->cur_speed;
/* Play a running sound if the motion counter passes 256 (Do we not skip sounds?) */