From 011a40cf91ab4737961ecc1c3fbdac9a13606e71 Mon Sep 17 00:00:00 2001 From: Melvin Melonstorm Date: Wed, 25 Jan 2012 23:30:14 +0100 Subject: [PATCH] Prevent delivery chute sound spam --- code/modules/recycling/sortingmachinery.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 code/modules/recycling/sortingmachinery.dm diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm old mode 100644 new mode 100755 index 27710f9bb28..18969389223 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -316,6 +316,7 @@ desc = "A chute for big and small packages alike!" density = 0 icon_state = "intake" + var/currentlyFlushing = 0 interact() return @@ -351,8 +352,13 @@ air_contents = new() // new empty gas resv. - sleep(10) - playsound(src, 'disposalflush.ogg', 50, 0, 0) + sleep(10) // Prevent sound spam when several objects are flushed simultaneously. + if(!currentlyFlushing) + currentlyFlushing = 1 + playsound(src, 'disposalflush.ogg', 50, 0, 0) + spawn(17) // Sound file is ~3 seconds long, adjust this if it becomes longer/shorter. + currentlyFlushing = 0 + sleep(5) // wait for animation to finish