Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CODE] CPropDrivableAPC incorrectly sets m_bUnableToFire #243

Open
samisalreadytaken opened this issue Jan 1, 2024 · 0 comments
Open

[CODE] CPropDrivableAPC incorrectly sets m_bUnableToFire #243

samisalreadytaken opened this issue Jan 1, 2024 · 0 comments

Comments

@samisalreadytaken
Copy link

samisalreadytaken commented Jan 1, 2024

Describe the bug

Due to the use of HLSS_APC_PITCH_FIX (-1.5) in pitch calculation, fabs(newTargetPitch-targetPitch) > 1e-4 check inside otherwise-copy-pasted CPropDrivableAPC::AimGunAt() always passes and sets m_bUnableToFire to true.

This causes vscript HUDs to incorrectly visualise that the gun is clamped at all times.

Since m_bUnableToFire is unused in EZ code, the simplest fix would be to simply remove the block that sets it to true. Or else the math should be fixed.

float newTargetPitch = HLSS_APC_PITCH_FIX + clamp( targetPitch, -CANNON_MAX_UP_PITCH, max_down_pitch );
//newTargetYaw += apc_zoomed_yaw_fix.GetFloat();
//newTargetPitch += apc_zoomed_pitch_fix.GetFloat();
//DevMsg("newTargetPitch: %f\n", newTargetPitch);
// If the angles have been clamped, we're looking outside of our valid range
if ( fabs(newTargetYaw-targetYaw) > 1e-4 || fabs(newTargetPitch-targetPitch) > 1e-4 )
{
m_bUnableToFire = true;
}

To visually see this in game, you may download the csgo panorama hud after compiling EZ2 with Mapbase PRs 260 and 261, set cl_crosshairstyle 3 (or 4) and get in the APC. The workshop version of this hud will be updated with the new materials when these patches are pushed live, obviously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant