summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/newgrf_sound.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf_sound.cpp b/src/newgrf_sound.cpp
index a25c3abcc..0756d798f 100644
--- a/src/newgrf_sound.cpp
+++ b/src/newgrf_sound.cpp
@@ -32,9 +32,9 @@ static std::vector<SoundEntry> _sounds;
*/
SoundEntry *AllocateSound(uint num)
{
- SoundEntry *sound = grow(_sounds, num);
- MemSetT(sound, 0, num);
- return sound;
+ size_t pos = _sounds.size();
+ _sounds.insert(_sounds.end(), num, SoundEntry());
+ return &_sounds[pos];
}