From f9598c8ba8ac42a813a188f84789884a7ed7eb25 Mon Sep 17 00:00:00 2001 From: def Date: Sun, 3 Nov 2019 18:10:30 +0100 Subject: [PATCH] Don't access m_aClients wiht invalid ClientID --- src/game/client/components/players.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/players.cpp b/src/game/client/components/players.cpp index 0d816e7aa..0c42f5c42 100644 --- a/src/game/client/components/players.cpp +++ b/src/game/client/components/players.cpp @@ -561,7 +561,10 @@ void CPlayers::RenderPlayer( Graphics()->QuadsSetRotation(0); } - if(g_Config.m_ClAfkEmote && m_pClient->m_aClients[ClientID].m_Afk && !(Player.m_PlayerFlags&PLAYERFLAG_CHATTING) && !(m_pClient->Client()->DummyConnected() && ClientID == m_pClient->m_LocalIDs[!g_Config.m_ClDummy])) + if(ClientID < 0) + return; + + if(g_Config.m_ClAfkEmote && m_pClient->m_aClients[ClientID].m_Afk && !(Player.m_PlayerFlags&PLAYERFLAG_CHATTING) && !(Client()->DummyConnected() && ClientID == m_pClient->m_LocalIDs[!g_Config.m_ClDummy])) { Graphics()->TextureSet(g_pData->m_aImages[IMAGE_EMOTICONS].m_Id); int QuadOffset = QuadOffsetToEmoticon + (SPRITE_ZZZ - SPRITE_OOP); @@ -572,9 +575,6 @@ void CPlayers::RenderPlayer( Graphics()->QuadsSetRotation(0); } - if(ClientID < 0) - return; - if(g_Config.m_ClShowEmotes && m_pClient->m_aClients[ClientID].m_EmoticonStart != -1 && m_pClient->m_aClients[ClientID].m_EmoticonStart + 2 * Client()->GameTickSpeed() > Client()->GameTick()) { Graphics()->TextureSet(g_pData->m_aImages[IMAGE_EMOTICONS].m_Id);