From 3eace445051661fe28cd6b65abc4ab09e9660aca Mon Sep 17 00:00:00 2001 From: flowtron Date: Thu, 6 Nov 2008 21:20:08 +0000 Subject: [PATCH] mutesound N/mutesound N 1 (=unmute) git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3429 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- docs/reference.xml | 1 + source/src/sound.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/reference.xml b/docs/reference.xml index ca953a30..9ef7aaa1 100644 --- a/docs/reference.xml +++ b/docs/reference.xml @@ -3032,6 +3032,7 @@ Output: + diff --git a/source/src/sound.cpp b/source/src/sound.cpp index 80dd19b6..77871047 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -1731,18 +1731,19 @@ void unmuteallsounds() loopv(gamesounds) gamesounds[i].muted = false; } -void mutesound(int n) +void mutesound(int n, int off) { + bool mute = (off == 0); if(!gamesounds.inrange(n)) { - conoutf("\f3could not silence sound no %d", n); + conoutf("\f3could not %s sound no %d", mute ? "silence" : "unmute", n); return; } - gamesounds[n].muted = true; + gamesounds[n].muted = mute; } COMMAND(unmuteallsounds, ARG_NONE); -COMMAND(mutesound, ARG_1INT); +COMMAND(mutesound, ARG_2INT); VARP(maxsoundsatonce, 0, 10, 100);