(svn r23882) -Codechange: Delay parsing of NewGRF sound effects until first usage.
This commit is contained in:
@@ -159,9 +159,18 @@ static void StartSound(SoundID sound_id, float pan, uint volume)
|
||||
{
|
||||
if (volume == 0) return;
|
||||
|
||||
const SoundEntry *sound = GetSound(sound_id);
|
||||
SoundEntry *sound = GetSound(sound_id);
|
||||
if (sound == NULL) return;
|
||||
|
||||
/* NewGRF sound that wasn't loaded yet? */
|
||||
if (sound->rate == 0 && sound->file_slot != 0) {
|
||||
if (!LoadNewGRFSound(sound)) {
|
||||
/* Mark as invalid. */
|
||||
sound->file_slot = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Empty sound? */
|
||||
if (sound->rate == 0) return;
|
||||
|
||||
|
Reference in New Issue
Block a user