From 04f09d9b572315fd5647b8e8bf766a2014aca3cd Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 22 Aug 2012 23:58:18 +0000 Subject: [PATCH] - Precache $ambient sounds. SVN r3844 (trunk) --- src/s_advsound.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index cf6f3831b2..f5b268348e 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -2072,6 +2072,7 @@ class AAmbientSound : public AActor public: void Serialize (FArchive &arc); + void MarkPrecacheSounds () const; void BeginPlay (); void Tick (); void Activate (AActor *activator); @@ -2098,6 +2099,22 @@ void AAmbientSound::Serialize (FArchive &arc) arc << bActive << NextCheck; } +//========================================================================== +// +// AmbientSound :: MarkPrecacheSounds +// +//========================================================================== + +void AAmbientSound::MarkPrecacheSounds() const +{ + Super::MarkPrecacheSounds(); + FAmbientSound *ambient = Ambients.CheckKey(args[0]); + if (ambient != NULL) + { + ambient->sound.MarkUsed(); + } +} + //========================================================================== // // AmbientSound :: Tick