summaryrefslogtreecommitdiff
path: root/newgrf_sound.c
diff options
context:
space:
mode:
Diffstat (limited to 'newgrf_sound.c')
-rw-r--r--newgrf_sound.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/newgrf_sound.c b/newgrf_sound.c
index 7d746f712..990629e82 100644
--- a/newgrf_sound.c
+++ b/newgrf_sound.c
@@ -68,6 +68,6 @@ bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event)
if (callback == CALLBACK_FAILED) return false;
if (callback >= GetNumOriginalSounds()) callback += file->sound_offset - GetNumOriginalSounds();
- SndPlayVehicleFx(callback, v);
+ if (callback < GetNumSounds()) SndPlayVehicleFx(callback, v);
return true;
}