From b3223d9324ca1ef709a6188985d5ad5326fdc32e Mon Sep 17 00:00:00 2001 From: Elinsrc <99191833+Elinsrc@users.noreply.github.com> Date: Sun, 9 Apr 2023 18:31:30 +0500 Subject: [PATCH] fixplayerscore (#364) --- dlls/multiplay_gamerules.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index da199271..e8e6a3b5 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -458,12 +458,13 @@ void CHalfLifeMultiplay::InitHUD( CBasePlayer *pl ) // sending just one score makes the hud scoreboard active; otherwise // it is just disabled for single play - MESSAGE_BEGIN( MSG_ONE, gmsgScoreInfo, NULL, pl->edict() ); + //fix a bug in the information about the player's score when he left the server, so that his score would not be transferred to another player(seems to work) + MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo ); WRITE_BYTE( ENTINDEX(pl->edict()) ); + WRITE_SHORT( (int)pl->pev->frags ); + WRITE_SHORT( pl->m_iDeaths ); WRITE_SHORT( 0 ); - WRITE_SHORT( 0 ); - WRITE_SHORT( 0 ); - WRITE_SHORT( 0 ); + WRITE_SHORT( GetTeamIndex( pl->m_szTeamName ) + 1 ); MESSAGE_END(); SendMOTDToClient( pl->edict() );