Browse Source

Merge pull request #54 from FreeSlave/fix_zoom_crosshair

Always update gHUD.m_iFOV on SetFOV message. Fix #53
caseclosed
Alibek Omarov 7 years ago committed by GitHub
parent
commit
632b324187
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cl_dll/hl/hl_weapons.cpp
  2. 5
      cl_dll/hud.cpp
  3. 2
      cl_dll/hud_msg.cpp

2
cl_dll/hl/hl_weapons.cpp

@ -34,7 +34,6 @@
extern globalvars_t *gpGlobals; extern globalvars_t *gpGlobals;
extern int g_iUser1; extern int g_iUser1;
extern bool g_hasPredictedFOV; // Vit_amiN: from HUD
// Pool of client side entities/entvars_t // Pool of client side entities/entvars_t
static entvars_t ev[32]; static entvars_t ev[32];
@ -882,7 +881,6 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
to->client.fuser2 = player.m_flNextAmmoBurn; to->client.fuser2 = player.m_flNextAmmoBurn;
to->client.fuser3 = player.m_flAmmoStartCharge; to->client.fuser3 = player.m_flAmmoStartCharge;
to->client.maxspeed = player.pev->maxspeed; to->client.maxspeed = player.pev->maxspeed;
g_hasPredictedFOV = true; // Vit_amiN: ready
//HL Weapons //HL Weapons
to->client.vuser1[0] = player.ammo_9mm; to->client.vuser1[0] = player.ammo_9mm;

5
cl_dll/hud.cpp

@ -413,7 +413,6 @@ int CHud::MsgFunc_Logo( const char *pszName, int iSize, void *pbuf )
} }
float g_lastFOV = 0.0; float g_lastFOV = 0.0;
bool g_hasPredictedFOV = false; // Vit_amiN: it'll became true after the first prediction
/* /*
============ ============
@ -514,10 +513,6 @@ int CHud::MsgFunc_SetFOV( const char *pszName, int iSize, void *pbuf )
int newfov = READ_BYTE(); int newfov = READ_BYTE();
int def_fov = CVAR_GET_FLOAT( "default_fov" ); int def_fov = CVAR_GET_FLOAT( "default_fov" );
//Weapon prediction already takes care of changing the fog. ( g_lastFOV ).
if( g_hasPredictedFOV )
return 1;
g_lastFOV = newfov; g_lastFOV = newfov;
if( newfov == 0 ) if( newfov == 0 )

2
cl_dll/hud_msg.cpp

@ -28,7 +28,6 @@ extern BEAM *pBeam2;
extern TEMPENTITY *pFlare; // Vit_amiN extern TEMPENTITY *pFlare; // Vit_amiN
extern float g_lastFOV; // Vit_amiN extern float g_lastFOV; // Vit_amiN
extern bool g_hasPredictedFOV; // Vit_amiN
/// USER-DEFINED SERVER MESSAGE HANDLERS /// USER-DEFINED SERVER MESSAGE HANDLERS
@ -55,7 +54,6 @@ int CHud::MsgFunc_ResetHUD( const char *pszName, int iSize, void *pbuf )
// Vit_amiN: reset the FOV // Vit_amiN: reset the FOV
m_iFOV = 0; // default_fov m_iFOV = 0; // default_fov
g_lastFOV = 0.0f; g_lastFOV = 0.0f;
g_hasPredictedFOV = false;
return 1; return 1;
} }

Loading…
Cancel
Save