Ignorerad command small optimization (#481)

This commit is contained in:
Dmitry 2019-12-25 19:36:26 +07:00 committed by Dmitry Novikov
parent 1f615d36b5
commit 7b0dab916d

View File

@ -372,6 +372,10 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Radio)(const char *msg_id, const char *msg
if (!pPlayer) if (!pPlayer)
continue; continue;
// ignorerad command
if (pPlayer->m_bIgnoreRadio)
continue;
// are we a regular player? (not spectator) // are we a regular player? (not spectator)
if (pPlayer->IsPlayer()) if (pPlayer->IsPlayer())
{ {
@ -400,9 +404,6 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Radio)(const char *msg_id, const char *msg
} }
if (bSend) if (bSend)
{
// ignorerad command
if (!pPlayer->m_bIgnoreRadio)
{ {
MESSAGE_BEGIN(MSG_ONE, gmsgSendAudio, nullptr, pEntity->pev); MESSAGE_BEGIN(MSG_ONE, gmsgSendAudio, nullptr, pEntity->pev);
WRITE_BYTE(ENTINDEX(edict())); WRITE_BYTE(ENTINDEX(edict()));
@ -453,7 +454,6 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Radio)(const char *msg_id, const char *msg
} }
} }
} }
}
void CBasePlayer::SmartRadio() void CBasePlayer::SmartRadio()
{ {