From 491da14d9b1e772d9245c1e50c3ed8602d75f221 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 16 Sep 2010 16:29:23 +0000 Subject: [PATCH] - Changed the ambient sound timer to use level.maptime instead of gametic so that it gets paused along with the rest of the game automatically. SVN r2799 (trunk) --- src/s_advsound.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index 46d4bc813e..39ef8f75cd 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -2013,7 +2013,7 @@ void AAmbientSound::Serialize (FArchive &arc) NextCheck += gametic; if (NextCheck < 0) NextCheck = INT_MAX; } - else + else if (SaveVersion < 2798) { if (arc.IsStoring()) { @@ -2036,6 +2036,10 @@ void AAmbientSound::Serialize (FArchive &arc) } } } + else + { + arc << NextCheck; + } } //========================================================================== @@ -2048,7 +2052,7 @@ void AAmbientSound::Tick () { Super::Tick (); - if (!bActive || gametic < NextCheck) + if (!bActive || level.maptime < NextCheck) return; FAmbientSound *ambient; @@ -2176,7 +2180,7 @@ void AAmbientSound::Activate (AActor *activator) amb->periodmin = Scale(S_GetMSLength(sndnum), TICRATE, 1000); } - NextCheck = gametic; + NextCheck = level.maptime; if (amb->type & (RANDOM|PERIODIC)) SetTicker (amb);