From 70239099124005bc4f1f3261958f31e9ff10b75e Mon Sep 17 00:00:00 2001 From: "petethegoat@gmail.com" Date: Mon, 24 Sep 2012 12:24:33 +0000 Subject: [PATCH] Changed toggle midis to a client verb. Fixed it even harder this time. Worked fine in testing, please report any issues to me straight away. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4750 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/verbs/sound.dm | 18 +++++++----------- code/modules/admin/verbs/playsound.dm | 6 ++---- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/code/game/verbs/sound.dm b/code/game/verbs/sound.dm index 294cef03ddf..11d0205dea4 100644 --- a/code/game/verbs/sound.dm +++ b/code/game/verbs/sound.dm @@ -1,19 +1,15 @@ -/mob/verb/togglemidis() +/client/verb/togglemidis() set category = "Special Verbs" set name = "Toggle Midis" set desc = "This will prevent further admin midis from playing, as well as cut off the current one." - if(istype(usr,/mob)) - var/mob/M = usr - - if(M.client) - M.client.midis = !M.client.midis - if(!M.client.midis) - M << sound(null, repeat = 0, wait = 0, channel = 777) // breaks the client's sound output on channel 777 - - M << "You will now [M.client.midis? "start":"stop"] receiving any sounds uploaded by admins[M.client.midis? "":", and any current midis playing have been disabled"]." - return + midis = !midis + if(!midis) + var/sound/break_sound = sound(null, repeat = 0, wait = 0, channel = 777) + break_sound.priority = 250 + src << break_sound //breaks the client's sound output on channel 777 + src << "You will now [midis? "start":"stop"] receiving any sounds uploaded by admins[midis? "":", and any current midis playing have been disabled"]." /mob/verb/toggletitlemusic() diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 0550f3c66ab..ff2c0a8dc57 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -6,10 +6,8 @@ src << "Only administrators may use this command." return - var/sound/uploaded_sound = sound(S,0,1,0) - uploaded_sound.channel = 777 - uploaded_sound.priority = 255 - uploaded_sound.wait = 1 + var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = 777) + uploaded_sound.priority = 250 if(src.holder.rank == "Game Master" || src.holder.rank == "Game Admin" || src.holder.rank == "Badmin") log_admin("[key_name(src)] played sound [S]")