summaryrefslogtreecommitdiff
path: root/src/newgrf_sound.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-21 11:29:01 +0000
committerrubidium <rubidium@openttd.org>2008-04-21 11:29:01 +0000
commita40bba8bace426b961d31f5b0362629044c0766e (patch)
tree05dfb2564e3487afc402523c5fbe4b764fc97d54 /src/newgrf_sound.cpp
parent2a779a5e100be9133e21b5645d90d0d390af9ecd (diff)
downloadopenttd-a40bba8bace426b961d31f5b0362629044c0766e.tar.xz
(svn r12817) -Feature: the ability to play NewGRF sounds for industries and stations.
Diffstat (limited to 'src/newgrf_sound.cpp')
-rw-r--r--src/newgrf_sound.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/newgrf_sound.cpp b/src/newgrf_sound.cpp
index 6c017b377..adafd8d90 100644
--- a/src/newgrf_sound.cpp
+++ b/src/newgrf_sound.cpp
@@ -69,9 +69,11 @@ bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event)
return true;
}
-bool PlayHouseSound(uint16 sound_id, TileIndex tile)
+bool PlayTileSound(const GRFFile *file, uint16 sound_id, TileIndex tile)
{
- if (sound_id < GetNumOriginalSounds()) {
+ if (sound_id >= GetNumOriginalSounds()) sound_id += file->sound_offset - GetNumOriginalSounds();
+
+ if (sound_id < GetNumSounds()) {
SndPlayTileFx((SoundFx)sound_id, tile);
return true;
}