Skip to content

Commit

Permalink
Always change view rolling on client side.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekonomicon committed Apr 30, 2023
1 parent 0f1cb31 commit 1ed4c1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
14 changes: 2 additions & 12 deletions cl_dll/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ float g_hud_text_color[3];
extern client_sprite_t *GetSpriteList( client_sprite_t *pList, const char *psz, int iRes, int iCount );

extern cvar_t *sensitivity;
qboolean bIsXash;
cvar_t *cl_lw = NULL;
cvar_t *cl_viewbob = NULL;
cvar_t *cl_rollspeed;
Expand Down Expand Up @@ -384,17 +383,8 @@ void CHud::Init( void )
m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE );
cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" );
cl_viewbob = CVAR_CREATE( "cl_viewbob", "0", FCVAR_ARCHIVE );
#if GOLDSOURCE_SUPPORT
if( gEngfuncs.pfnGetCvarPointer( "build" ))
{
bIsXash = true;
}
else
{
cl_rollangle = gEngfuncs.pfnRegisterVariable( "cl_rollangle", "0", FCVAR_CLIENTDLL | FCVAR_ARCHIVE );
cl_rollspeed = gEngfuncs.pfnRegisterVariable( "cl_rollspeed", "200", FCVAR_CLIENTDLL | FCVAR_ARCHIVE );
}
#endif
cl_rollangle = gEngfuncs.pfnRegisterVariable( "cl_rollangle", "0", FCVAR_CLIENTDLL | FCVAR_ARCHIVE );
cl_rollspeed = gEngfuncs.pfnRegisterVariable( "cl_rollspeed", "200", FCVAR_CLIENTDLL | FCVAR_ARCHIVE );
m_pSpriteList = NULL;

// Clear any old HUD list
Expand Down
12 changes: 3 additions & 9 deletions cl_dll/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ void V_AddIdle( struct ref_params_s *pparams )
pparams->viewangles[YAW] += v_idlescale * sin( pparams->time * v_iyaw_cycle.value ) * v_iyaw_level.value;
}

extern qboolean bIsXash;
extern cvar_t *cl_rollspeed;
extern cvar_t *cl_rollangle;

Expand All @@ -332,14 +331,9 @@ void V_CalcViewRoll( struct ref_params_s *pparams )
viewentity = gEngfuncs.GetEntityByIndex( pparams->viewentity );
if( !viewentity )
return;
#if GOLDSOURCE_SUPPORT
if( bIsXash )
side = V_CalcRoll( viewentity->angles, pparams->simvel, pparams->movevars->rollangle, pparams->movevars->rollspeed );
else
side = V_CalcRoll( viewentity->angles, pparams->simvel, cl_rollangle->value, cl_rollspeed->value );
#else
side = V_CalcRoll( viewentity->angles, pparams->simvel, pparams->movevars->rollangle, pparams->movevars->rollspeed );
#endif

side = V_CalcRoll( viewentity->angles, pparams->simvel, cl_rollangle->value, cl_rollspeed->value );

pparams->viewangles[ROLL] += side;

if( pparams->health <= 0 && ( pparams->viewheight[2] != 0 ) )
Expand Down

0 comments on commit 1ed4c1d

Please sign in to comment.