Repository navigation
Count only guns toward the compare page's accuracy [patch] - #95
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
The compare page summed hits and shots over every weapon, but only guns record shots: a knife or Zeus hit added to the numerator with nothing in the denominator, so 20 AK hits from 100 shots plus 30 knife hits showed 50%. Hits and shots are now summed over guns only, matching LifeTracker. Fixes #93 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5PUccwNk8Pndsg92E
Contributor
Author
|
CI is red on both test legs, but the cause is already on
This PR doesn't touch either file. #82 tracks the failure and #85 fixes it. With #85's package change applied locally, this branch's full suite passes (742 passed, 7 skipped). Once #85 merges, this PR's CI should go green on the next run. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #93
What changed
CompareViewBuilder.SidesummedHitsandShotsover every weapon. Only guns record shots:OnWeaponFirereturns early for anything that isn't a gun. So knife and Zeus hits were added to the numerator with no matching shots in the denominator. For example, 20 AK hits from 100 shots plus 30 knife hits showed 50% accuracy.Hits and shots are now summed only over weapons where
WeaponCatalog.Find(key)?.IsGun == true. This matchesLifeTracker's per-life accuracy. Kills and headshot % still count every weapon.Tests
CompareTests.Build_AccuracyCountsOnlyGunsBecauseKnifeAndZeusRecordNoShots. It adds knife and taser hits to a player and checks that Accuracy stays at the gun-only 50%. It fails without the fix and passes with it.Note:
maindoesn't build at the moment (#82: KTSU0006 in the Site). #85 fixes that, and this PR's CI will fail at build until #85 merges. I ran the tests above with #85's two-line package change applied locally. That change is not part of this PR.Generated by Claude Code