diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index fd704d571..001b73fe2 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -851,24 +851,23 @@ void CCharacter::TickDeferred() int Events = m_Core.m_TriggeredEvents; int CID = m_pPlayer->GetCid(); - CClientMask TeamMask = Teams()->TeamMask(Team(), -1, CID); - // Some sounds are triggered client-side for the acting player + // Some sounds are triggered client-side for the acting player (or for all players on Sixup) // so we need to avoid duplicating them - CClientMask TeamMaskExceptSelf = Teams()->TeamMask(Team(), CID, CID); + CClientMask TeamMaskExceptSelfAndSixup = Teams()->TeamMask(Team(), -1, CID, CGameContext::FLAG_SIX); // Some are triggered client-side but only on Sixup - CClientMask TeamMaskExceptSelfIfSixup = Server()->IsSixup(CID) ? TeamMaskExceptSelf : TeamMask; + CClientMask TeamMaskExceptSixup = Teams()->TeamMask(Team(), -1, CID, CGameContext::FLAG_SIX); if(Events & COREEVENT_GROUND_JUMP) - GameServer()->CreateSound(m_Pos, SOUND_PLAYER_JUMP, TeamMaskExceptSelf); + GameServer()->CreateSound(m_Pos, SOUND_PLAYER_JUMP, TeamMaskExceptSelfAndSixup); if(Events & COREEVENT_HOOK_ATTACH_PLAYER) - GameServer()->CreateSound(m_Pos, SOUND_HOOK_ATTACH_PLAYER, TeamMaskExceptSelfIfSixup); + GameServer()->CreateSound(m_Pos, SOUND_HOOK_ATTACH_PLAYER, TeamMaskExceptSixup); if(Events & COREEVENT_HOOK_ATTACH_GROUND) - GameServer()->CreateSound(m_Pos, SOUND_HOOK_ATTACH_GROUND, TeamMaskExceptSelf); + GameServer()->CreateSound(m_Pos, SOUND_HOOK_ATTACH_GROUND, TeamMaskExceptSelfAndSixup); if(Events & COREEVENT_HOOK_HIT_NOHOOK) - GameServer()->CreateSound(m_Pos, SOUND_HOOK_NOATTACH, TeamMaskExceptSelf); + GameServer()->CreateSound(m_Pos, SOUND_HOOK_NOATTACH, TeamMaskExceptSelfAndSixup); if(Events & COREEVENT_GROUND_JUMP) m_TriggeredEvents7 |= protocol7::COREEVENTFLAG_GROUND_JUMP; diff --git a/src/game/server/teams.cpp b/src/game/server/teams.cpp index 6e255f653..2f4b58bdf 100644 --- a/src/game/server/teams.cpp +++ b/src/game/server/teams.cpp @@ -507,7 +507,7 @@ bool CGameTeams::TeamFinished(int Team) return true; } -CClientMask CGameTeams::TeamMask(int Team, int ExceptId, int Asker) +CClientMask CGameTeams::TeamMask(int Team, int ExceptId, int Asker, int VersionFlags) { if(Team == TEAM_SUPER) { @@ -523,6 +523,9 @@ CClientMask CGameTeams::TeamMask(int Team, int ExceptId, int Asker) continue; // Explicitly excluded if(!GetPlayer(i)) continue; // Player doesn't exist + if(!((Server()->IsSixup(i) && (VersionFlags & CGameContext::FLAG_SIXUP)) || + (!Server()->IsSixup(i) && (VersionFlags & CGameContext::FLAG_SIX)))) + continue; if(!(GetPlayer(i)->GetTeam() == TEAM_SPECTATORS || GetPlayer(i)->IsPaused())) { // Not spectator diff --git a/src/game/server/teams.h b/src/game/server/teams.h index fec2af311..a836dc71e 100644 --- a/src/game/server/teams.h +++ b/src/game/server/teams.h @@ -97,7 +97,7 @@ public: void ChangeTeamState(int Team, int State); - CClientMask TeamMask(int Team, int ExceptId = -1, int Asker = -1); + CClientMask TeamMask(int Team, int ExceptId = -1, int Asker = -1, int VersionFlags = CGameContext::FLAG_SIX | CGameContext::FLAG_SIXUP); int Count(int Team) const;