Skip to content

Commit

Permalink
fixed bug in sendSkinChange method, apperently I was sending to clien…
Browse files Browse the repository at this point in the history
…ts who aren't ingame yet, fixed #29
  • Loading branch information
AssassinTee committed Apr 27, 2019
1 parent 05c6a7a commit 90b201b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/game/server/gamecontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,11 @@ void CGameContext::SendSkinChange(int ClientID, int TargetID)
{
for(int i = 0; i < MAX_PLAYERS; ++i)
{
if(m_apPlayers[i] && !m_apPlayers[i]->IsDummy())
SendSkinChange(ClientID, i);
SendSkinChange(ClientID, i);
}
}
else if(!m_apPlayers[TargetID] || m_apPlayers[TargetID]->IsDummy() || !Server()->ClientIngame(TargetID))
return;
else if(Server()->GetClientVersion(TargetID) >= MIN_SKINCHANGE_CLIENTVERSION)//Send normal message
{
CNetMsg_Sv_SkinChange Msg;
Expand Down Expand Up @@ -1320,6 +1321,10 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
Msg.m_pMessage = "Your skinchange will apply next round";
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientID);

char aBuf[128];
str_format(aBuf, sizeof(aBuf), "Player '%s' updated skin", Server()->ClientName(ClientID));
Console()->Print(IConsole::OUTPUT_LEVEL_DEBUG, "server", aBuf);

//SendChat(-1, CHAT_ALL, ClientID, "Your skinchange will apply next round");
// update all clients//don't update, the update will apply next round
/*for(int i = 0; i < MAX_CLIENTS; ++i)
Expand Down

0 comments on commit 90b201b

Please sign in to comment.