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