diff options
author | frosch <frosch@openttd.org> | 2012-03-19 22:55:29 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-03-19 22:55:29 +0000 |
commit | 0643a6976467fe85ffae88687477c971e45ec596 (patch) | |
tree | 42bbce64578c63a6f38582dac5c65826300b7be4 /src/newgrf_sound.cpp | |
parent | 2007f7affdd38a6ef5c7482f99e8d0d831a8bfee (diff) | |
download | openttd-0643a6976467fe85ffae88687477c971e45ec596.tar.xz |
(svn r24052) -Fix (r23883) [FS#5107]: Imported GRF sounds were inserted into the wrong slots.
Diffstat (limited to 'src/newgrf_sound.cpp')
-rw-r--r-- | src/newgrf_sound.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/newgrf_sound.cpp b/src/newgrf_sound.cpp index 5abd443c9..b82853ac6 100644 --- a/src/newgrf_sound.cpp +++ b/src/newgrf_sound.cpp @@ -22,11 +22,15 @@ static SmallVector<SoundEntry, 8> _sounds; -/* Allocate a new Sound */ -SoundEntry *AllocateSound() +/** + * Allocate sound slots. + * @param num Number of slots to allocate. + * @return First allocated slot. + */ +SoundEntry *AllocateSound(uint num) { - SoundEntry *sound = _sounds.Append(); - MemSetT(sound, 0); + SoundEntry *sound = _sounds.Append(num); + MemSetT(sound, 0, num); return sound; } |