CLIENT: Better handling of crosshair recoil effect

This commit is contained in:
MotoLegacy 2024-11-26 14:00:35 -08:00
parent 9a33650b70
commit ee349fcc6c
3 changed files with 4 additions and 22 deletions

View file

@ -55,7 +55,7 @@ float hud_maxammo_starttime;
float nameprint_time;
float HUD_Change_time;
float Hitmark_time;
float crosshair_spread_time;
float recoil_kick_time;
float crosshair_pulse_grenade;
float zoom_2_time;

View file

@ -1346,25 +1346,6 @@ void() Draw_Crosshair =
if (getstatf(STAT_HEALTH) < 1)
return;
if (crosshair_spread_time > time && crosshair_spread_time)
{
cur_spread = cur_spread + 10;
if (cur_spread >= CrossHairMaxSpread(getstatf(STAT_ACTIVEWEAPON), getstatf(STAT_PLAYERSTANCE)))
cur_spread = CrossHairMaxSpread(getstatf(STAT_ACTIVEWEAPON), getstatf(STAT_PLAYERSTANCE));
if (!croshhairmoving)
cur_spread *= 1/2;
}
else if (crosshair_spread_time < time && crosshair_spread_time)
{
cur_spread = cur_spread - 0.25;
if (cur_spread <= 0)
{
cur_spread = 0;
crosshair_spread_time = 0;
}
}
// Standard crosshair (+)
if (crosshair_value == 1) {
int x_value, y_value;

View file

@ -488,7 +488,7 @@ void() DropRecoilKick =
{
float len;
if (crosshair_spread_time > time)
if (recoil_kick_time > time)
return;
len = VectorNormalize(gun_kick);
@ -1006,7 +1006,8 @@ noref void() CSQC_Parse_Event =
Hitmark_time = time + 0.2;
break;
case 5:
crosshair_spread_time = time + 70/getWeaponRecoilReturn(getstatf(STAT_ACTIVEWEAPON));
recoil_kick_time = time + 70/getWeaponRecoilReturn(getstatf(STAT_ACTIVEWEAPON));
cur_spread = CrossHairMaxSpread(getstatf(STAT_ACTIVEWEAPON), getstatf(STAT_PLAYERSTANCE));
break;
default:
break;