Skip to content

Commit 0eaa791

Browse files
committed
fix disconnecting players
1 parent 818907c commit 0eaa791

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/game/client/gameclient.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,6 +1731,7 @@ void CGameClient::OnNewSnapshot()
17311731
for(auto &Client : m_aClients)
17321732
{
17331733
Client.m_SpecCharPresent = false;
1734+
Client.m_ReceivedDDNetPlayerInfoInLastSnapshot = false;
17341735
}
17351736

17361737
// go through all the items in the snapshot and gather the info we want
@@ -1829,6 +1830,8 @@ void CGameClient::OnNewSnapshot()
18291830
}
18301831
else if(m_aStats[pInfo->m_ClientId].IsActive())
18311832
m_aStats[pInfo->m_ClientId].JoinSpec(Client()->GameTick(g_Config.m_ClDummy));
1833+
1834+
m_aClients[pInfo->m_ClientId].m_ReceivedDDNetPlayerInfoInLastSnapshot = true;
18321835
}
18331836
}
18341837
else if(Item.m_Type == NETOBJTYPE_DDNETPLAYER)
@@ -2110,6 +2113,11 @@ void CGameClient::OnNewSnapshot()
21102113
for(CClientData &Client : m_aClients)
21112114
{
21122115
Client.UpdateSkinInfo();
2116+
2117+
if(!Client.m_ReceivedDDNetPlayerInfoInLastSnapshot)
2118+
{
2119+
Client.m_CustomClient = 0;
2120+
}
21132121
}
21142122

21152123
// setup local pointers

src/game/client/gameclient.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ class CGameClient : public IGameClient
553553
CSixup m_aSixup[NUM_DUMMIES];
554554

555555
int m_CustomClient = 0;
556+
bool m_ReceivedDDNetPlayerInfoInLastSnapshot = false;
556557

557558
void KZReset();
558559
};

0 commit comments

Comments
 (0)