Add a toggle to disable aim assist #1277
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.