From 0fa92d59e271425c1dbbb919cfed80362d6be08b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 7 Jan 2019 17:28:30 +0100 Subject: [PATCH] - same for the ambient sound # Conflicts: # src/s_advsound.cpp --- src/s_advsound.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index d10f7aa3c0..0f11c18b69 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -2255,8 +2255,13 @@ DEFINE_ACTION_FUNCTION(AAmbientSound, Tick) PARAM_SELF_PROLOGUE(AActor); self->Tick(); + + if (self->special1 > 0) + { + if (--self->special1 > 0) return 0; + } - if (!self->special2 || level.maptime < self->special1) + if (!self->special2) return 0; FAmbientSound *ambient; @@ -2351,7 +2356,7 @@ DEFINE_ACTION_FUNCTION(AAmbientSound, Activate) amb->periodmin = ::Scale(S_GetMSLength(sndnum), TICRATE, 1000); } - self->special1 = level.maptime; + self->special1 = 0; if (amb->type & (RANDOM|PERIODIC)) self->special1 += GetTicker (amb);