Skip to content

Commit

Permalink
Team check small refactory
Browse files Browse the repository at this point in the history
  • Loading branch information
dystopm committed Jan 9, 2025
1 parent e89c774 commit f2fd4f7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions regamedll/dlls/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,13 @@ void Host_Say(edict_t *pEntity, BOOL teamonly)
if (gpGlobals->deathmatch != 0.0f && CSGameRules()->m_VoiceGameMgr.PlayerHasBlockedPlayer(pReceiver, pPlayer))
continue;

if (teamonly && pReceiver->m_iTeam != pPlayer->m_iTeam)
if (teamonly
#ifdef REGAMEDLL_FIXES
&& CSGameRules()->PlayerRelationship(pPlayer, pReceiver) != GR_TEAMMATE
#else
&& pReceiver->m_iTeam != pPlayer->m_iTeam
#endif
)
continue;

if (
Expand All @@ -1014,7 +1020,13 @@ void Host_Say(edict_t *pEntity, BOOL teamonly)
continue;
}

if ((pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_ENEMY && pReceiver->m_iTeam == pPlayer->m_iTeam)
if ((pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_ENEMY
#ifdef REGAMEDLL_FIXES
&& CSGameRules()->PlayerRelationship(pPlayer, pReceiver) == GR_TEAMMATE
#else
&& pReceiver->m_iTeam == pPlayer->m_iTeam
#endif
)
|| pReceiver->m_iIgnoreGlobalChat == IGNOREMSG_NONE)
{
MESSAGE_BEGIN(MSG_ONE, gmsgSayText, nullptr, pReceiver->pev);
Expand Down

0 comments on commit f2fd4f7

Please sign in to comment.