diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a5a3ff96f3..1e6b1e8838 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,7 @@ +October 9, 2009 (Changes by Graf Zahl) +- fixed: AAmbientSound::Serialize was adjusting its timer value for savegames + even when it was set to a 'don't check' value. + October 8, 2009 - Reinstated the off-by-one check in D3DFB from r399. I thought I could get by at just fixing it at a specific value, since the supply of SM14 cards isn't diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index 31d2d94f2b..11c541f45c 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -1917,11 +1917,34 @@ void AAmbientSound::Serialize (FArchive &arc) Super::Serialize (arc); arc << bActive; - int checktime = NextCheck - gametic; - arc << checktime; - if (arc.IsLoading ()) + if (SaveVersion < 1902) { - NextCheck = checktime + gametic; + arc << NextCheck; + NextCheck += gametic; + if (NextCheck < 0) NextCheck = INT_MAX; + } + else + { + if (arc.IsStoring()) + { + if (NextCheck != INT_MAX) + { + int checktime = NextCheck - gametic; + arc << checktime; + } + else + { + arc << NextCheck; + } + } + else + { + arc << NextCheck; + if (checktime != INT_MAX) + { + NextCheck += gametic; + } + } } }