summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2020-11-29 20:38:13 +0100
committerMichael Lutz <michi@icosahedron.de>2020-12-06 20:31:54 +0100
commit6198a4776b520cb433709aaa3a37cdeccbedbec0 (patch)
tree49b8574b4be72e87986fb786075d3d469b172d26 /src
parentcfa1b1e006b45780355a67d228124b8542c6335d (diff)
downloadopenttd-6198a4776b520cb433709aaa3a37cdeccbedbec0.tar.xz
Change: [NewGRF] Use aircraft property 12 also for helicopters.
Due to keeping compatibility we can only do this for NewGRF-defined sound effects.
Diffstat (limited to 'src')
-rw-r--r--src/aircraft_cmd.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index eec375d75..447615e3b 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -908,7 +908,11 @@ static bool AircraftController(Aircraft *v)
v->cur_speed = 0;
if (--u->cur_speed == 32) {
if (!PlayVehicleSound(v, VSE_START)) {
- SndPlayVehicleFx(SND_18_HELICOPTER, v);
+ SoundID sfx = AircraftVehInfo(v->engine_type)->sfx;
+ /* For compatibility with old NewGRF we ignore the sfx property, unless a NewGRF-defined sound is used.
+ * The baseset has only one helicopter sound, so this only limits using plane or cow sounds. */
+ if (sfx < ORIGINAL_SAMPLE_COUNT) sfx = SND_18_HELICOPTER;
+ SndPlayVehicleFx(sfx, v);
}
}
} else {