diff --git a/Source/server/defs.h b/Source/server/defs.h index ba7281d7..9cc6c8be 100644 --- a/Source/server/defs.h +++ b/Source/server/defs.h @@ -14,7 +14,7 @@ void Effect_Impact( int iType, vector vPos, vector vNormal ); void Effect_CreateExplosion( vector vPos ); void Footsteps_Update( void ); -void TraceAttack_FireBullets( int iShots, vector vPos, int iDamage); +void TraceAttack_FireBullets( int iShots, vector vPos, int iDamage, vector vecAccuracy); void Damage_Radius( vector vOrigin, entity eAttacker, float fDamage, float fRadius, int iCheckClip ); void Damage_Apply( entity eTarget, entity eAttacker, float fDamage, vector vHitPos, int iSkipArmor ); void Client_TriggerCamera( entity eTarget, vector vPos, vector vEndPos, float fResetTime ); diff --git a/Source/server/traceattack.c b/Source/server/traceattack.c index 2b64c4ed..b17ae2a9 100644 --- a/Source/server/traceattack.c +++ b/Source/server/traceattack.c @@ -141,18 +141,16 @@ TraceAttack_FireBullets Fire a given amount of shots ================= */ -void TraceAttack_FireBullets(int iShots, vector vPos, int iDamage) +void TraceAttack_FireBullets(int iShots, vector vPos, int iDamage, vector vecAccuracy) { vector vDir; makevectors(self.v_angle); while (iShots > 0) { iTotalPenetrations = 0; -#ifdef CSTRIKE - vDir = aim(self, 100000) + Math_CRandom()*self.fAccuracy*v_right + Math_CRandom()*self.fAccuracy*v_up; -#else - vDir = aim(self, 100000); -#endif + + vDir = aim(self, 100000) + Math_CRandom()*vecAccuracy[0]*v_right + Math_CRandom()*vecAccuracy[1]*v_up; + //TraceAttack_FireSingle(vPos, vDir, iDamage); TraceAttack_FireSingleLagged(vPos, vDir, iDamage); iShots--; diff --git a/Source/shared/cstrike/basegun.c b/Source/shared/cstrike/basegun.c index 1eb95998..94c3eaf4 100644 --- a/Source/shared/cstrike/basegun.c +++ b/Source/shared/cstrike/basegun.c @@ -133,7 +133,7 @@ float BaseGun_PrimaryFire( void ) { BaseGun_ShotMultiplierHandle( wptTable[ self.weapon ].iBullets ); BaseGun_AccuracyCalc(); - TraceAttack_FireBullets( wptTable[ self.weapon ].iBullets, ( self.origin + self.view_ofs ), wptTable[self.weapon].iDamage ); + TraceAttack_FireBullets( wptTable[ self.weapon ].iBullets, ( self.origin + self.view_ofs ), wptTable[self.weapon].iDamage, [self.fAccuracy, self.fAccuracy] ); Animation_ShootWeapon( self ); self.(wptTable[ self.weapon ].iMagfld) -= 1; diff --git a/Source/shared/cstrike/weaponglock18.c b/Source/shared/cstrike/weaponglock18.c index e1e16392..afed7705 100755 --- a/Source/shared/cstrike/weaponglock18.c +++ b/Source/shared/cstrike/weaponglock18.c @@ -86,7 +86,7 @@ void WeaponGLOCK18_PrimaryFire( void ) { if ( self.iMag_GLOCK18 ) { BaseGun_ShotMultiplierHandle( 1 ); BaseGun_AccuracyCalc(); - TraceAttack_FireBullets( 1, ( self.origin + self.view_ofs ), 25 ); + TraceAttack_FireBullets( 1, ( self.origin + self.view_ofs ), 25, [self.fAccuracy,self.fAccuracy]); self.iMag_GLOCK18 -= 1; } } diff --git a/Source/shared/pmove.c b/Source/shared/pmove.c index 45524fb3..758eea85 100644 --- a/Source/shared/pmove.c +++ b/Source/shared/pmove.c @@ -12,8 +12,6 @@ #define PHY_JUMP_CHAIN 100 #define PHY_JUMP_CHAINDECAY 50 -#define FL_JUMPRELEASED 4096 - /*FIXME: jumptime should use the time global, as time intervals are not predictable - decrement it based upon input_timelength*/ .float jumptime; .float waterlevel; diff --git a/Source/shared/valve/w_glock.c b/Source/shared/valve/w_glock.c index b55aebfc..306f09f0 100644 --- a/Source/shared/valve/w_glock.c +++ b/Source/shared/valve/w_glock.c @@ -90,7 +90,7 @@ void w_glock_primary(void) return; } - TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8); + TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8, [0.01,0,01]); pl.glock_mag--; @@ -126,7 +126,7 @@ void w_glock_secondary(void) return; } - TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8); + TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8, [0.1,0,1]); pl.glock_mag--; diff --git a/Source/shared/valve/w_mp5.c b/Source/shared/valve/w_mp5.c index 88c55110..238e96bc 100644 --- a/Source/shared/valve/w_mp5.c +++ b/Source/shared/valve/w_mp5.c @@ -76,7 +76,12 @@ void w_mp5_primary(void) Weapons_ViewPunchAngle([random(-2, 2),0,0]); #else - TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 5); + /* Singleplayer is more accurate */ + if (cvar("sv_clientslots") == 1) { + TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8, [0.02618,0.02618]); + } else { + TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 8, [0.05234,0.05234]); + } if (random() < 0.5) { Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/hks1.wav", 1, ATTN_NORM); diff --git a/Source/shared/valve/w_python.c b/Source/shared/valve/w_python.c index 7ef5175d..a1582eed 100644 --- a/Source/shared/valve/w_python.c +++ b/Source/shared/valve/w_python.c @@ -69,7 +69,7 @@ void w_python_primary(void) } #ifdef SSQC - TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 40); + TraceAttack_FireBullets(1, pl.origin + pl.view_ofs, 40, [0.00873, 0.00873]); #endif Weapons_ViewAnimation(PYTHON_FIRE1); diff --git a/Source/shared/valve/w_shotgun.c b/Source/shared/valve/w_shotgun.c index a9368cf8..07731cc3 100644 --- a/Source/shared/valve/w_shotgun.c +++ b/Source/shared/valve/w_shotgun.c @@ -64,6 +64,16 @@ void w_shotgun_primary(void) Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/sbarrel1.wav", 1, ATTN_NORM); Weapons_ViewAnimation(SHOTGUN_FIRE1); Weapons_ViewPunchAngle([-5,0,0]); + +#ifdef SSQC + /* Singleplayer is more accurate */ + if (cvar("sv_clientslots") == 1) { + TraceAttack_FireBullets(6, pl.origin + pl.view_ofs, 5, [0.08716,0.08716]); + } else { + TraceAttack_FireBullets(4, pl.origin + pl.view_ofs, 5, [0.08716,0.04362]); + } +#endif + pl.w_attack_next = Math_Time() + 0.75; pl.w_idle_next = Math_Time() + 2.5f; } @@ -74,6 +84,15 @@ void w_shotgun_secondary(void) return; } +#ifdef SSQC + /* Singleplayer is more accurate */ + if (cvar("sv_clientslots") == 1) { + TraceAttack_FireBullets(12, pl.origin + pl.view_ofs, 5, [0.08716,0.08716]); + } else { + TraceAttack_FireBullets(8, pl.origin + pl.view_ofs, 5, [0.17365,0.04362]); + } +#endif + Weapons_PlaySound(pl, CHAN_WEAPON, "weapons/dbarrel1.wav", 1, ATTN_NORM); Weapons_ViewAnimation(SHOTGUN_FIRE2); Weapons_ViewPunchAngle([-10,0,0]); diff --git a/cstrike/csprogs.dat b/cstrike/csprogs.dat index 3d9d3207..5dad84b9 100644 Binary files a/cstrike/csprogs.dat and b/cstrike/csprogs.dat differ diff --git a/cstrike/progs.dat b/cstrike/progs.dat index 61e1658f..34231196 100644 Binary files a/cstrike/progs.dat and b/cstrike/progs.dat differ diff --git a/scihunt/progs.dat b/scihunt/progs.dat index 62d7cf58..d69cb16b 100644 Binary files a/scihunt/progs.dat and b/scihunt/progs.dat differ diff --git a/valve/csprogs.dat b/valve/csprogs.dat index babefe17..a383b47e 100644 Binary files a/valve/csprogs.dat and b/valve/csprogs.dat differ diff --git a/valve/menu.dat b/valve/menu.dat index f603e53b..ec5dfc81 100644 Binary files a/valve/menu.dat and b/valve/menu.dat differ diff --git a/valve/progs.dat b/valve/progs.dat index 7946c8d6..5c44f27f 100644 Binary files a/valve/progs.dat and b/valve/progs.dat differ