don't play local VCs if voicecomsounds is "Off"
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5569 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -399,18 +399,17 @@ void audiomanager::writesoundconfig(stream *f)
|
||||
loopv(gamesounds) if(gamesounds[i].muted) f->printf("mutesound %d\n", i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void voicecom(char *sound, char *text)
|
||||
{
|
||||
if(!sound || !sound[0]) return;
|
||||
static int last = 0;
|
||||
if(!last || lastmillis-last > 2000)
|
||||
{
|
||||
extern int voicecomsounds;
|
||||
defformatstring(soundpath)("voicecom/%s", sound);
|
||||
int s = audiomgr.findsound(soundpath, 0, gamesounds);
|
||||
if(s < 0 || s < S_AFFIRMATIVE || s >= S_NULL) return;
|
||||
audiomgr.playsound(s, SP_HIGH);
|
||||
if(voicecomsounds>0) audiomgr.playsound(s, SP_HIGH);
|
||||
if(s >= S_NICESHOT) // public
|
||||
{
|
||||
addmsg(SV_VOICECOM, "ri", s);
|
||||
@@ -428,8 +427,6 @@ void voicecom(char *sound, char *text)
|
||||
|
||||
COMMAND(voicecom, ARG_2STR);
|
||||
|
||||
|
||||
|
||||
void soundtest()
|
||||
{
|
||||
loopi(S_NULL) audiomgr.playsound(i, rnd(SP_HIGH+1));
|
||||
@@ -437,8 +434,6 @@ void soundtest()
|
||||
|
||||
COMMAND(soundtest, ARG_NONE);
|
||||
|
||||
|
||||
|
||||
// sound configuration
|
||||
|
||||
soundconfig::soundconfig(sbuffer *b, int vol, int maxuses, bool loop, int audibleradius)
|
||||
@@ -465,9 +460,6 @@ void soundconfig::ondetach()
|
||||
|
||||
vector<soundconfig> gamesounds, mapsounds;
|
||||
|
||||
|
||||
|
||||
|
||||
void audiomanager::detachsounds(playerent *owner)
|
||||
{
|
||||
if(nosound) return;
|
||||
|
||||
@@ -1261,6 +1261,7 @@ void *kickmenu = NULL, *banmenu = NULL, *forceteammenu = NULL, *giveadminmenu =
|
||||
|
||||
void refreshsopmenu(void *menu, bool init)
|
||||
{
|
||||
//TODO: add a text-field for giving a reason
|
||||
menureset(menu);
|
||||
mlines.shrink(0);
|
||||
mlines.reserve(players.length());
|
||||
@@ -1268,6 +1269,7 @@ void refreshsopmenu(void *menu, bool init)
|
||||
{
|
||||
mline &m = mlines.add();
|
||||
copystring(m.name, colorname(players[i]));
|
||||
//formatstring(m.cmd)("%s %d%s", menu==kickmenu ? "kick" : (menu==banmenu ? "ban" : (menu==forceteammenu ? "forceteam" : "giveadmin")), i, (menu==kickmenu||menu==banmenu)?" NONE":"");
|
||||
formatstring(m.cmd)("%s %d", menu==kickmenu ? "kick" : (menu==banmenu ? "ban" : (menu==forceteammenu ? "forceteam" : "giveadmin")), i);
|
||||
menumanual(menu, m.name, m.cmd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user