Skip to content

Commit

Permalink
Play correct team sounds when in spectator mode and following a player.
Browse files Browse the repository at this point in the history
  • Loading branch information
zturtleman committed Oct 11, 2012
1 parent cf30922 commit 0a8eb09
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions code/cgame/cg_event.c
Expand Up @@ -1033,27 +1033,27 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
DEBUGNAME("EV_GLOBAL_TEAM_SOUND");
switch( es->eventParm ) {
case GTS_RED_CAPTURE: // CTF: red team captured the blue flag, 1FCTF: red team captured the neutral flag
if ( cgs.clientinfo[cg.clientNum].team == TEAM_RED )
if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED )
CG_AddBufferedSound( cgs.media.captureYourTeamSound );
else
CG_AddBufferedSound( cgs.media.captureOpponentSound );
break;
case GTS_BLUE_CAPTURE: // CTF: blue team captured the red flag, 1FCTF: blue team captured the neutral flag
if ( cgs.clientinfo[cg.clientNum].team == TEAM_BLUE )
if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE )
CG_AddBufferedSound( cgs.media.captureYourTeamSound );
else
CG_AddBufferedSound( cgs.media.captureOpponentSound );
break;
case GTS_RED_RETURN: // CTF: blue flag returned, 1FCTF: never used
if ( cgs.clientinfo[cg.clientNum].team == TEAM_RED )
if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED )
CG_AddBufferedSound( cgs.media.returnYourTeamSound );
else
CG_AddBufferedSound( cgs.media.returnOpponentSound );
//
CG_AddBufferedSound( cgs.media.blueFlagReturnedSound );
break;
case GTS_BLUE_RETURN: // CTF red flag returned, 1FCTF: neutral flag returned
if ( cgs.clientinfo[cg.clientNum].team == TEAM_BLUE )
if ( cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE )
CG_AddBufferedSound( cgs.media.returnYourTeamSound );
else
CG_AddBufferedSound( cgs.media.returnOpponentSound );
Expand All @@ -1066,15 +1066,15 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
if (cg.snap->ps.powerups[PW_BLUEFLAG] || cg.snap->ps.powerups[PW_NEUTRALFLAG]) {
}
else {
if (cgs.clientinfo[cg.clientNum].team == TEAM_BLUE) {
if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE) {
#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.yourTeamTookTheFlagSound );
else
#endif
CG_AddBufferedSound( cgs.media.enemyTookYourFlagSound );
}
else if (cgs.clientinfo[cg.clientNum].team == TEAM_RED) {
else if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED) {
#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.enemyTookTheFlagSound );
Expand All @@ -1089,15 +1089,15 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
if (cg.snap->ps.powerups[PW_REDFLAG] || cg.snap->ps.powerups[PW_NEUTRALFLAG]) {
}
else {
if (cgs.clientinfo[cg.clientNum].team == TEAM_RED) {
if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED) {
#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.yourTeamTookTheFlagSound );
else
#endif
CG_AddBufferedSound( cgs.media.enemyTookYourFlagSound );
}
else if (cgs.clientinfo[cg.clientNum].team == TEAM_BLUE) {
else if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE) {
#ifdef MISSIONPACK
if (cgs.gametype == GT_1FCTF)
CG_AddBufferedSound( cgs.media.enemyTookTheFlagSound );
Expand All @@ -1109,12 +1109,12 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {
break;
#ifdef MISSIONPACK
case GTS_REDOBELISK_ATTACKED: // Overload: red obelisk is being attacked
if (cgs.clientinfo[cg.clientNum].team == TEAM_RED) {
if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED) {
CG_AddBufferedSound( cgs.media.yourBaseIsUnderAttackSound );
}
break;
case GTS_BLUEOBELISK_ATTACKED: // Overload: blue obelisk is being attacked
if (cgs.clientinfo[cg.clientNum].team == TEAM_BLUE) {
if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE) {
CG_AddBufferedSound( cgs.media.yourBaseIsUnderAttackSound );
}
break;
Expand Down

0 comments on commit 0a8eb09

Please sign in to comment.