Skip to content

Commit

Permalink
update cgahook
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Feb 25, 2024
1 parent 7dfd6c2 commit 15b09d0
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions cgahook/gameservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,17 @@ void __cdecl NewNET_ParseWorkingResult(int a1, int success, int type, const char
void CGAService::NewNET_ParseChatMsg(int a1, int unitid, const char *buf, int color, int size)
{
//WriteLog("NewNET_ParseChatMsg u=%d, buf=%s, color=%d, size=%d\n", unitid, buf, color, size);
if (m_ui_block_chatmsgs > 0 && buf[0] == 'P' && buf[1] == '|')
{
if (m_ui_block_chatmsgs >= 2)
return;

if (m_ui_block_chatmsgs == 1)
{
if (!IsPlayerInTeam(unitid))
return;
}
}

if (buf[0] == 'P' && buf[1] == '|')
{
Expand Down Expand Up @@ -1639,18 +1650,6 @@ bool CGAService::IsPlayerInTeam(int unitId)

void __cdecl NewNET_ParseChatMsg(int a1, int unitid, const char *buf, int color, int size)
{
if (g_CGAService.m_ui_block_chatmsgs > 0 && buf[0] == 'P' && buf[1] == '|' && unitid != -1)
{
if(g_CGAService.m_ui_block_chatmsgs >= 2)
return;

if (g_CGAService.m_ui_block_chatmsgs == 1)
{
if(!g_CGAService.IsPlayerInTeam(unitid))
return;
}
}

g_CGAService.NewNET_ParseChatMsg(a1, unitid, buf, color, size);
}

Expand Down

0 comments on commit 15b09d0

Please sign in to comment.