mirror of
https://github.com/nzp-team/quakec.git
synced 2025-02-15 16:41:41 +00:00
CLIENT: Better handling of crosshair recoil effect
This commit is contained in:
parent
9a33650b70
commit
ee349fcc6c
3 changed files with 4 additions and 22 deletions
|
@ -55,7 +55,7 @@ float hud_maxammo_starttime;
|
||||||
float nameprint_time;
|
float nameprint_time;
|
||||||
float HUD_Change_time;
|
float HUD_Change_time;
|
||||||
float Hitmark_time;
|
float Hitmark_time;
|
||||||
float crosshair_spread_time;
|
float recoil_kick_time;
|
||||||
float crosshair_pulse_grenade;
|
float crosshair_pulse_grenade;
|
||||||
float zoom_2_time;
|
float zoom_2_time;
|
||||||
|
|
||||||
|
|
|
@ -1346,25 +1346,6 @@ void() Draw_Crosshair =
|
||||||
if (getstatf(STAT_HEALTH) < 1)
|
if (getstatf(STAT_HEALTH) < 1)
|
||||||
return;
|
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 (+)
|
// Standard crosshair (+)
|
||||||
if (crosshair_value == 1) {
|
if (crosshair_value == 1) {
|
||||||
int x_value, y_value;
|
int x_value, y_value;
|
||||||
|
|
|
@ -488,7 +488,7 @@ void() DropRecoilKick =
|
||||||
{
|
{
|
||||||
float len;
|
float len;
|
||||||
|
|
||||||
if (crosshair_spread_time > time)
|
if (recoil_kick_time > time)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
len = VectorNormalize(gun_kick);
|
len = VectorNormalize(gun_kick);
|
||||||
|
@ -1006,7 +1006,8 @@ noref void() CSQC_Parse_Event =
|
||||||
Hitmark_time = time + 0.2;
|
Hitmark_time = time + 0.2;
|
||||||
break;
|
break;
|
||||||
case 5:
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue