summaryrefslogtreecommitdiff
path: root/src/newgrf_sound.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-03-19 22:55:29 +0000
committerfrosch <frosch@openttd.org>2012-03-19 22:55:29 +0000
commit0643a6976467fe85ffae88687477c971e45ec596 (patch)
tree42bbce64578c63a6f38582dac5c65826300b7be4 /src/newgrf_sound.cpp
parent2007f7affdd38a6ef5c7482f99e8d0d831a8bfee (diff)
downloadopenttd-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.cpp12
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;
}