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

Add a toggle to disable aim assist #1277

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

Iridar
Copy link
Contributor

@Iridar Iridar commented Oct 28, 2023

Fixes #1228

I found only one place in the entire codebase that's relevant to Aim Assist, though I could have missed something.

The place in question is the GetModifiedHitChanceForCurrentDifficulty() function, which applies some modifications to ability's hit chance based on the in-game circumstances, and then if the team is XCOM and the attack missed, it may be flipped to a hit, and if the team is Alien or Lost, then a hit may be flipped to a miss.

Both cases will get logged.

This PR just adds one bool switch to CHHelpers which is checked only in GetModifiedHitChanceForCurrentDifficulty(), and then the function just returns unmodified hit chance.

I briefly considered also checking the bool switch to bypass the logic that would call GetModifiedHitChanceForCurrentDifficulty(), but it shouldn't be necessary.

Note that the mod Extended Information that has an option to display Aim Assist will be unaffected by the bool switch, and will still display aim assist, because it uses copypasted code from X2AbilityToHitCalc_StandardAim to calculate Aim Assist bonus.

@Iridar Iridar added enhancement ready-to-review A pull request is ready to be reviewed labels Oct 28, 2023
@Iridar Iridar added this to the 1.27.0 milestone Oct 28, 2023
@Iridar Iridar self-assigned this Oct 28, 2023
@Iridar Iridar force-pushed the 1128-disable-aim-assist branch from 930ea58 to 16fe852 Compare October 29, 2023 16:51
@Iridar Iridar force-pushed the 1128-disable-aim-assist branch from 16fe852 to 8837c83 Compare October 29, 2023 16:54
@Iridar Iridar merged commit 57541b6 into X2CommunityCore:master Oct 29, 2023
4 checks passed
@Iridar Iridar deleted the 1128-disable-aim-assist branch October 29, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ready-to-review A pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a toggle to disable Aim Assist
2 participants