mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-26 05:41:20 +00:00
CLIENT/FTE: Fix M2 Flamethrower crosshair not disappearing when ADS
This commit is contained in:
parent
240d116728
commit
065c369600
1 changed files with 32 additions and 29 deletions
|
@ -1212,38 +1212,41 @@ void() Draw_Crosshair =
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getstatf(STAT_ACTIVEWEAPON) == W_M2 || getstatf(STAT_ACTIVEWEAPON) == W_TESLA || getstatf(STAT_ACTIVEWEAPON) == W_DG3)
|
if (getstatf(STAT_WEAPONZOOM) != 1 && getstatf(STAT_WEAPONZOOM) != 2) {
|
||||||
{
|
// 'O' crosshair
|
||||||
float circle_offset = stringwidth("O", 0, [12, 12])/2;
|
if (getstatf(STAT_ACTIVEWEAPON) == W_M2 || getstatf(STAT_ACTIVEWEAPON) == W_FIW || getstatf(STAT_ACTIVEWEAPON) == W_TESLA || getstatf(STAT_ACTIVEWEAPON) == W_DG3) {
|
||||||
drawstring([g_width/2 - circle_offset, g_height/2 - circle_offset], "O", [12, 12], crosshair_color, 1, 0);
|
float circle_offset = stringwidth("O", 0, [12, 12])/2;
|
||||||
}
|
drawstring([g_width/2 - circle_offset, g_height/2 - circle_offset], "O", [12, 12], crosshair_color, 1, 0);
|
||||||
else if (getstatf(STAT_WEAPONZOOM) != 1 && getstatf(STAT_WEAPONZOOM) != 2 && getstatf(STAT_ACTIVEWEAPON) != W_PANZER && getstatf(STAT_ACTIVEWEAPON) != W_LONGINUS) // naievil (FIXME) crosshair cvar
|
}
|
||||||
{
|
// '.' crosshair
|
||||||
int x_value, y_value;
|
else if (getstatf(STAT_ACTIVEWEAPON) == W_PANZER || getstatf(STAT_ACTIVEWEAPON) == W_LONGINUS) {
|
||||||
int crosshair_offset;
|
vector screenSize2 = [g_width, g_height];
|
||||||
|
drawfill(screenSize2 / 2 - [2, 2], [4, 4], crosshair_color, crosshair_opacity, 0); // dot
|
||||||
crosshair_offset = CrossHairWeapon(getstatf(STAT_ACTIVEWEAPON), getstatf(STAT_PLAYERSTANCE)) + cur_spread;
|
}
|
||||||
|
// Standard crosshair
|
||||||
if (CrossHairMaxSpread(getstatf(STAT_ACTIVEWEAPON), getstatf(STAT_PLAYERSTANCE)) < crosshair_offset)
|
else {
|
||||||
crosshair_offset = CrossHairMaxSpread(getstatf(STAT_ACTIVEWEAPON), getstatf(STAT_PLAYERSTANCE));
|
int x_value, y_value;
|
||||||
|
int crosshair_offset;
|
||||||
if (perks & P_DEAD)
|
|
||||||
crosshair_offset *= 0.65;
|
crosshair_offset = CrossHairWeapon(getstatf(STAT_ACTIVEWEAPON), getstatf(STAT_PLAYERSTANCE)) + cur_spread;
|
||||||
|
|
||||||
|
if (CrossHairMaxSpread(getstatf(STAT_ACTIVEWEAPON), getstatf(STAT_PLAYERSTANCE)) < crosshair_offset)
|
||||||
|
crosshair_offset = CrossHairMaxSpread(getstatf(STAT_ACTIVEWEAPON), getstatf(STAT_PLAYERSTANCE));
|
||||||
|
|
||||||
|
if (perks & P_DEAD)
|
||||||
|
crosshair_offset *= 0.65;
|
||||||
|
|
||||||
crosshair_offset_step += (crosshair_offset - crosshair_offset_step) * 0.5;
|
crosshair_offset_step += (crosshair_offset - crosshair_offset_step) * 0.5;
|
||||||
|
|
||||||
// Creds to heartologic for some actually good crosshair position stuff.
|
// Creds to heartologic for some actually good crosshair position stuff.
|
||||||
vector crossSize = [1, 5];
|
vector crossSize = [1, 5];
|
||||||
vector screenSize = [g_width, g_height];
|
vector screenSize = [g_width, g_height];
|
||||||
|
|
||||||
drawfill(screenSize / 2 - [crossSize.x, +crossSize.y * 2 + crosshair_offset_step], crossSize, crosshair_color, crosshair_opacity, 0); // top
|
drawfill(screenSize / 2 - [crossSize.x, +crossSize.y * 2 + crosshair_offset_step], crossSize, crosshair_color, crosshair_opacity, 0); // top
|
||||||
drawfill(screenSize / 2 - [crossSize.x, -crossSize.y * 1 - crosshair_offset_step], crossSize, crosshair_color, crosshair_opacity, 0); // bottom
|
drawfill(screenSize / 2 - [crossSize.x, -crossSize.y * 1 - crosshair_offset_step], crossSize, crosshair_color, crosshair_opacity, 0); // bottom
|
||||||
drawfill(screenSize / 2 - [+crossSize.y * 2 + crosshair_offset_step, crossSize.x], [crossSize.y, crossSize.x], crosshair_color, crosshair_opacity, 0); // right
|
drawfill(screenSize / 2 - [+crossSize.y * 2 + crosshair_offset_step, crossSize.x], [crossSize.y, crossSize.x], crosshair_color, crosshair_opacity, 0); // right
|
||||||
drawfill(screenSize / 2 - [-crossSize.y * 1 - crosshair_offset_step, crossSize.x], [crossSize.y, crossSize.x], crosshair_color, crosshair_opacity, 0); // left
|
drawfill(screenSize / 2 - [-crossSize.y * 1 - crosshair_offset_step, crossSize.x], [crossSize.y, crossSize.x], crosshair_color, crosshair_opacity, 0); // left
|
||||||
}
|
}
|
||||||
else if (getstatf(STAT_WEAPONZOOM) != 1 && getstatf(STAT_WEAPONZOOM) != 2) {
|
|
||||||
vector screenSize2 = [g_width, g_height];
|
|
||||||
drawfill(screenSize2 / 2 - [2, 2], [4, 4], crosshair_color, crosshair_opacity, 0); // dot
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue