diff --git a/Source/Client/Defs.h b/Source/Client/Defs.h index ba6e88eb..dc4ddb8c 100755 --- a/Source/Client/Defs.h +++ b/Source/Client/Defs.h @@ -36,13 +36,14 @@ var float FONT_16; var vector autocvar_con_color = '255 170 0'; // autocvar of "con_color" var vector autocvar_vgui_color = '255 170 0'; // autocvar of "vgui_color" 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 int autocvar_cl_bobclassic = FALSE; +var float autocvar_cl_bob = 0; +var float autocvar_v_bob = 0.01; +var float autocvar_v_bobcycle = 0.8; +var float autocvar_v_bobup = 0.5; +var int autocvar_v_bobclassic = FALSE; var int autocvar_v_lefthanded = FALSE; var int autocvar_cl_thirdperson = FALSE; -var int autocvar_cl_radar = 2; +var int autocvar_cl_radar = 1; // Particle stuff var float PARTICLE_SPARK; diff --git a/Source/Client/Entities.c b/Source/Client/Entities.c index 0c8c4a22..13b95155 100755 --- a/Source/Client/Entities.c +++ b/Source/Client/Entities.c @@ -40,9 +40,9 @@ void CSQC_Ent_Update( float flIsNew ) { self.predraw = Player_PreDraw; self.drawmask = MASK_ENGINE; self.pmove_frame = servercommandframe; - } - else + } else { Player_PreUpdate(); + } self.modelindex = readbyte(); self.origin_x = readcoord(); diff --git a/Source/Client/View.c b/Source/Client/View.c index 6223aa8f..acbf42dc 100755 --- a/Source/Client/View.c +++ b/Source/Client/View.c @@ -63,33 +63,54 @@ void View_CalcBob( void ) { } pSeat->fBobTime += frametime; - fCycle = pSeat->fBobTime - (int)( pSeat->fBobTime / autocvar_cl_bobcycle ) * autocvar_cl_bobcycle; - fCycle /= autocvar_cl_bobcycle; + fCycle = pSeat->fBobTime - (int)( pSeat->fBobTime / autocvar_v_bobcycle ) * autocvar_v_bobcycle; + fCycle /= autocvar_v_bobcycle; - if ( fCycle < autocvar_cl_bobup ) { - fCycle = MATH_PI * fCycle / autocvar_cl_bobup; + if ( fCycle < autocvar_v_bobup ) { + fCycle = MATH_PI * fCycle / autocvar_v_bobup; } else { - fCycle = MATH_PI + MATH_PI * ( fCycle - autocvar_cl_bobup )/( 1.0 - autocvar_cl_bobup ); + fCycle = MATH_PI + MATH_PI * ( fCycle - autocvar_v_bobup )/( 1.0 - autocvar_v_bobup ); } vVelocity = pSeat->vPlayerVelocity; vVelocity_z = 0; - float fBob = sqrt( vVelocity_x * vVelocity_x + vVelocity_y * vVelocity_y ) * autocvar_cl_bob; + float fBob = sqrt( vVelocity_x * vVelocity_x + vVelocity_y * vVelocity_y ) * autocvar_v_bob; fBob = fBob * 0.3 + fBob * 0.7 * sin( fCycle ); pSeat->fBob = bound( -7, fBob, 4 ); } +/* +==================== +View_DropPunchAngle + +Quickly lerp to the original viewposition +==================== +*/ void View_DropPunchAngle( void ) { float fLerp; fLerp = 1.0f - ( frametime * 4 ); pSeat->vPunchAngle *= fLerp; } +/* +==================== +View_AddPunchAngle + +Gives the angle a bit of an offset/punch/kick +==================== +*/ void View_AddPunchAngle( vector vAdd ) { pSeat->vPunchAngle += vAdd; } +/* +==================== +View_ShellEject + +Spawns a shell tempentity. Looking fancy +==================== +*/ void View_ShellEject( void ) { static void View_ShellEject_Death( void ) { remove( self ); @@ -105,6 +126,7 @@ void View_ShellEject( void ) { setmodel( eShell, sShellModel[ wptTable[ getstati( STAT_ACTIVEWEAPON ) ].iShellType ] ); eShell.movetype = MOVETYPE_BOUNCE; eShell.drawmask = MASK_ENGINE; + eShell.angles = [ 0, view_angles_y, 0 ]; eShell.velocity = pSeat->vPlayerVelocity + ( v_up * random( 70, 120 ) ) + ( v_right * -random( 50, 70 ) ); eShell.think = View_ShellEject_Death; eShell.nextthink = time + 2.5f; @@ -113,6 +135,9 @@ void View_ShellEject( void ) { /* ==================== View_ProcessEvent + +Called by the engine whenever a model +tries to play an event. ==================== */ void View_ProcessEvent( float fTimeStamp, int iCode, string sData ) { @@ -148,6 +173,9 @@ void View_ProcessEvent( float fTimeStamp, int iCode, string sData ) { /* ==================== View_DrawViewModel + +Really convoluted function that makes the gun, +muzzleflash, dynamic lights and so on appear ==================== */ void View_DrawViewModel( void ) { @@ -193,7 +221,6 @@ void View_DrawViewModel( void ) { float fBaseTime = eViewModel.frame1time; eViewModel.frame1time += frametime; eViewModel.frame2time += frametime; - processmodelevents( eViewModel.modelindex, eViewModel.frame, fBaseTime, eViewModel.frame1time, View_ProcessEvent ); } @@ -213,7 +240,7 @@ void View_DrawViewModel( void ) { } // Give the gun a tilt effect like in old HL/CS versions - if ( autocvar_cl_bobclassic == 1 ) { + if ( autocvar_v_bobclassic == 1 ) { eViewModel.angles_z = -pSeat->fBob; } @@ -225,14 +252,16 @@ void View_DrawViewModel( void ) { dynamiclight_add( pSeat->vPlayerOrigin, 400 * eMuzzleflash.alpha, '1 0.45 0'); addentity( eMuzzleflash ); } - addentity( eViewModel ); } } /* ==================== -View_DrawViewModel +View_PlayAnimation + +Resets the timeline and plays a new sequence +onto the view model ==================== */ void View_PlayAnimation( int iSequence ) { diff --git a/Source/FreeCS-CE.prj b/Source/FreeCS-CE.prj index b021c670..e37cce07 100644 --- a/Source/FreeCS-CE.prj +++ b/Source/FreeCS-CE.prj @@ -63,7 +63,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -117,20 +117,6 @@ - - - - - - - - - - - - - - - + diff --git a/Source/Server/Defs.h b/Source/Server/Defs.h index ad24e1a9..52296cdc 100755 --- a/Source/Server/Defs.h +++ b/Source/Server/Defs.h @@ -139,6 +139,7 @@ void Weapon_DropWeapon( int iSlot ); float Weapon_GetAnimType( float fWeapon ); float Weapon_GetFireRate( float fWeapon ); float Weapon_GetReloadTime( float fWeapon ); +void Weapon_Reload( float fWeapon ); void BaseGun_AccuracyCalc( void ); void BaseGun_Draw( void ); diff --git a/Source/Shared/BaseGun.c b/Source/Shared/BaseGun.c index 5400eb50..5f39d064 100755 --- a/Source/Shared/BaseGun.c +++ b/Source/Shared/BaseGun.c @@ -135,6 +135,9 @@ Returns whether or not to play an animation float BaseGun_PrimaryFire( void ) { // Nothing in the clip anymore? Don't even attempt if ( ( self.(wptTable[ self.weapon ].iMagfld) - 1 ) < 0 ) { + if ( autocvar_mp_autoreload == TRUE ) { + Weapon_Reload( self.weapon ); + } return FALSE; } diff --git a/freecs/csprogs.dat b/freecs/csprogs.dat index 7d927b84..fe5fe99d 100644 Binary files a/freecs/csprogs.dat and b/freecs/csprogs.dat differ diff --git a/freecs/default.cfg b/freecs/default.cfg index 86fd9dd4..34d776c3 100644 --- a/freecs/default.cfg +++ b/freecs/default.cfg @@ -45,9 +45,10 @@ seta mp_freezetime 6 seta mp_c4timer 45 seta mp_roundtime 5 seta mp_fillweapons 0 -seta cl_bobcycle 0.8 -seta cl_bob 0.01 -seta cl_bobup 0.5 +seta cl_bob 0 +seta v_bobcycle 0.8 +seta v_bob 0.01 +seta v_bobup 0.5 seta r_particledesc default seta pm_bunnyspeedcap "1" seta sv_accelerate "4" diff --git a/freecs/progs.dat b/freecs/progs.dat index 7d69758e..0f39cae3 100644 Binary files a/freecs/progs.dat and b/freecs/progs.dat differ