mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix emotes sometimes being shown for others tees
The `Translate` function modifies the first argument, so the client ID keeps changing when the function is being used in a loop. Additionally, calling `Translate` manually is not necessary for messages, as client IDs in messages are already automatically translated when using `SendPackMsg`. Both faults can cause emoticons to appear on the wrong players when the emote spamprotection limits emotes to nearby players.
This commit is contained in:
parent
8fc5549306
commit
92dc3d4a0f
|
@ -2541,8 +2541,7 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MAX_CLIENTS; ++i)
|
for(int i = 0; i < MAX_CLIENTS; ++i)
|
||||||
{
|
{
|
||||||
if(Server()->Translate(ClientID, i) &&
|
if(m_apPlayers[i] && pChr->CanSnapCharacter(i) && pChr->IsSnappingCharacterInView(i))
|
||||||
m_apPlayers[i] && pChr->CanSnapCharacter(i) && pChr->IsSnappingCharacterInView(i))
|
|
||||||
{
|
{
|
||||||
SendEmoticon(ClientID, pMsg->m_Emoticon, i);
|
SendEmoticon(ClientID, pMsg->m_Emoticon, i);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue