diff --git a/code/cgame/cg_main.c b/code/cgame/cg_main.c index 16d2fe7d3..085925b1b 100644 --- a/code/cgame/cg_main.c +++ b/code/cgame/cg_main.c @@ -758,6 +758,10 @@ static void CG_RegisterSounds(void) { cgs.media.padaceSound = trap_S_RegisterSound("sound/feedback/awards/padace", qtrue); cgs.media.padstarSound = trap_S_RegisterSound("sound/feedback/awards/padstar", qtrue); + cgs.media.voteNow = trap_S_RegisterSound("sound/feedback/vote_now", qtrue); + cgs.media.votePassed = trap_S_RegisterSound("sound/feedback/vote_passed", qtrue); + cgs.media.voteFailed = trap_S_RegisterSound("sound/feedback/vote_failed", qtrue); + cgs.media.watrInSound = trap_S_RegisterSound("sound/padplayer/water_in", qfalse); cgs.media.watrOutSound = trap_S_RegisterSound("sound/padplayer/water_out", qfalse); cgs.media.watrUnSound = trap_S_RegisterSound("sound/padplayer/water_under", qfalse); diff --git a/code/cgame/cg_servercmds.c b/code/cgame/cg_servercmds.c index 64d36ce99..194b61547 100644 --- a/code/cgame/cg_servercmds.c +++ b/code/cgame/cg_servercmds.c @@ -329,6 +329,7 @@ static void CG_ConfigStringModified(void) { cgs.voteModified = qtrue; } else if (num == CS_VOTE_STRING) { Q_strncpyz(cgs.voteString, str, sizeof(cgs.voteString)); + trap_S_StartLocalSound(cgs.media.voteNow, CHAN_ANNOUNCER); } else if (num >= CS_TEAMVOTE_TIME && num <= CS_TEAMVOTE_TIME + 1) { cgs.teamVoteTime[num - CS_TEAMVOTE_TIME] = atoi(str); cgs.teamVoteModified[num - CS_TEAMVOTE_TIME] = qtrue; @@ -340,6 +341,7 @@ static void CG_ConfigStringModified(void) { cgs.teamVoteModified[num - CS_TEAMVOTE_NO] = qtrue; } else if (num >= CS_TEAMVOTE_STRING && num <= CS_TEAMVOTE_STRING + 1) { Q_strncpyz(cgs.teamVoteString[num - CS_TEAMVOTE_STRING], str, sizeof(cgs.teamVoteString)); + trap_S_StartLocalSound(cgs.media.voteNow, CHAN_ANNOUNCER); } else if (num == CS_INTERMISSION) { cg.intermissionStarted = atoi(str); } else if (num >= CS_MODELS && num < CS_MODELS + MAX_MODELS) { @@ -548,6 +550,13 @@ static void CG_ServerCommand(void) { if (!strcmp(cmd, "print")) { CG_Printf("%s", CG_Argv(1)); + cmd = CG_Argv(1); // yes, this is obviously a hack, but so is the way we hear about + // votes passing or failing + if (!Q_stricmpn(cmd, "vote failed", 11) || !Q_stricmpn(cmd, "team vote failed", 16)) { + trap_S_StartLocalSound(cgs.media.voteFailed, CHAN_ANNOUNCER); + } else if (!Q_stricmpn(cmd, "vote passed", 11) || !Q_stricmpn(cmd, "team vote passed", 16)) { + trap_S_StartLocalSound(cgs.media.votePassed, CHAN_ANNOUNCER); + } return; }