summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-17 17:00:30 +0000
committerrubidium <rubidium@openttd.org>2009-05-17 17:00:30 +0000
commite3bd95e7b6694a68a73bbb2649d6f96092e2e313 (patch)
treef73cb380561e96882470f26572568f15ab690bf6
parent570af0ce449b6c94427233d7eae07c40bb789197 (diff)
downloadopenttd-e3bd95e7b6694a68a73bbb2649d6f96092e2e313.tar.xz
(svn r16339) -Fix: [NewGRF] When overriding 'original sounds', only allow overriding of the 'original sounds' and not any other that is already loaded.
-rw-r--r--src/newgrf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index b058d8fd0..1a4a2ca33 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -2039,8 +2039,8 @@ static ChangeInfoResult SoundEffectChangeInfo(uint sid, int numinfo, int prop, b
case 0x0A: { // Override old sound
uint orig_sound = grf_load_byte(&buf);
- if (orig_sound >= GetNumSounds()) {
- grfmsg(1, "SoundEffectChangeInfo: Original sound %d not defined (max %d)", orig_sound, GetNumSounds());
+ if (orig_sound >= ORIGINAL_SAMPLE_COUNT) {
+ grfmsg(1, "SoundEffectChangeInfo: Original sound %d not defined (max %d)", orig_sound, ORIGINAL_SAMPLE_COUNT);
} else {
FileEntry *newfe = GetSound(sound);
FileEntry *oldfe = GetSound(orig_sound);