From 324f03fa3b447a85e608091d533dc8ef9df37b80 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Thu, 28 Dec 2017 00:17:47 +0500 Subject: [PATCH] Fix NVG. --- dlls/player.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/player.cpp b/dlls/player.cpp index f24a89c2..5b64b83c 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -3870,6 +3870,7 @@ void CBasePlayer::UpdateClientData( void ) { if( m_fInitHUD ) { + BOOL bFlashLightStatus; m_fInitHUD = FALSE; gInitHUD = FALSE; @@ -3896,11 +3897,17 @@ void CBasePlayer::UpdateClientData( void ) FireTargets( "game_playerspawn", this, this, USE_TOGGLE, 0 ); // Send flashlight status + bFlashLightStatus = FlashlightIsOn(); + MESSAGE_BEGIN( MSG_ONE, gmsgFlashlight, NULL, pev ); - WRITE_BYTE( FlashlightIsOn() ? 1 : 0 ); + WRITE_BYTE( bFlashLightStatus ); WRITE_BYTE( m_iFlashBattery ); MESSAGE_END(); + MESSAGE_BEGIN( MSG_ONE, gmsgNightvision, NULL, pev ); + WRITE_BYTE( bFlashLightStatus ); + MESSAGE_END(); + InitStatusBar(); }