diff --git a/Source/Client/Defs.h b/Source/Client/Defs.h index 560b0b69..62318abc 100644 --- a/Source/Client/Defs.h +++ b/Source/Client/Defs.h @@ -31,6 +31,7 @@ var vector autocvar_cross_color = '0 255 0'; // autocvar of "cross_color" var float autocvar_cl_bob = 0.01; var float autocvar_cl_bobcycle = 0.8; var float autocvar_cl_bobup = 0.5; +var float autocvar_cl_bobclassic = 0; vector vHUDColor; // Defined in HUD_Draw (HUD.c) vector vVGUIColor; // Defined in HUD_Draw (VGUI.c) diff --git a/Source/Client/Nightvision.c b/Source/Client/Nightvision.c index 07829ec1..2408ca1c 100644 --- a/Source/Client/Nightvision.c +++ b/Source/Client/Nightvision.c @@ -59,7 +59,7 @@ void Nightvision_PreDraw( void ) { } if ( iNightVision == TRUE ) { - dynamiclight_add( getproperty( VF_ORIGIN ), 500, '0 0.75 0'); + dynamiclight_add( getproperty( VF_ORIGIN ), 500, '0 0.45 0'); } } diff --git a/Source/Client/VGUIObjects.c b/Source/Client/VGUIObjects.c index 27ba52ef..1b7ec45b 100644 --- a/Source/Client/VGUIObjects.c +++ b/Source/Client/VGUIObjects.c @@ -135,8 +135,6 @@ void VGUI_FakeButton( string sLabel, vector vPos, vector vSize ) { // Draw the button label v4_x = vPos_x + 16; v4_y = vPos_y + ( ( vSize_y / 2 ) - 4 ); - - drawstring( v4, sLabel, '8 8 0', vVGUIColor * 0.5, VGUI_WINDOW_FGALPHA, DRAWFLAG_ADDITIVE ); } diff --git a/Source/Client/View.c b/Source/Client/View.c index 8a3f37c3..14752778 100644 --- a/Source/Client/View.c +++ b/Source/Client/View.c @@ -76,26 +76,24 @@ float View_CalcBob( void ) { vVelocity_z = 0; fBob = sqrt( vVelocity_x * vVelocity_x + vVelocity_y * vVelocity_y ) * autocvar_cl_bob; - fBob = fBob * 0.3 + fBob * 0.7 * sin(fCycle); + fBob = fBob * 0.3 + fBob * 0.7 * sin( fCycle ); fBob = min( fBob, 4 ); fBob = max( fBob, -7 ); - return fBob * 0.5; + return fBob; } entity eViewModel; void View_DrawViewModel( void ) { static float fLastTime; - + static float fBob; if( !eViewModel ) { eViewModel = spawn(); eViewModel.renderflags = RF_DEPTHHACK; } if ( time != fLastTime ) { - makevectors( getproperty( VF_ANGLES ) ); - eViewModel.origin = getproperty( VF_ORIGIN ) + '0 0 -1' + ( v_forward * View_CalcBob() ); - eViewModel.angles = getproperty( VF_ANGLES ); + fBob = View_CalcBob(); if( getstatf( STAT_ACTIVEWEAPON ) < CS_WEAPON_COUNT ) { setmodel( eViewModel, sViewModels[ getstatf( STAT_ACTIVEWEAPON ) ] ); @@ -104,6 +102,15 @@ void View_DrawViewModel( void ) { eViewModel.frame1time += frametime; } + makevectors( getproperty( VF_ANGLES ) ); + eViewModel.origin = getproperty( VF_ORIGIN ) + '0 0 -1' + ( v_forward * ( fBob * 0.4 ) ); + eViewModel.angles = getproperty( VF_ANGLES ); + + // Give the gun a tilt effect like in old HL/CS versions + if ( autocvar_cl_bobclassic == 1 ) { + eViewModel.angles_z = -fBob; + } + fLastTime = time; addentity( eViewModel ); } diff --git a/Source/Globals.h b/Source/Globals.h index 526d5c7d..06b68ca6 100644 --- a/Source/Globals.h +++ b/Source/Globals.h @@ -161,8 +161,8 @@ typedef struct { float fRangeModifier; // ??? float fWeaponType; - float fAttackFinished; // When is the gone done firing - float fReloadFinished; // When is the gone done firing + float fAttackFinished; + float fReloadFinished; .int iCaliberfld; // Pointer towards the caliberfield of the gun .int iMagfld; // Pointer towards the clip of the gun