- 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)
This commit is contained in:
Christoph Oelckers 2010-09-16 16:29:23 +00:00
parent 4da5ce74ca
commit 491da14d9b

View file

@ -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);