Fix the reported Exam value by using the calculated value fixes #8776#8974
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8974 +/- ##
============================================
+ Coverage 13.81% 13.95% +0.14%
- Complexity 8186 8274 +88
============================================
Files 1284 1285 +1
Lines 167640 167941 +301
Branches 25323 25414 +91
============================================
+ Hits 23157 23434 +277
+ Misses 142153 142064 -89
- Partials 2330 2443 +113 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a UI inconsistency in the personnel market personality/exam display by ensuring the “Performance Exam” detail text is generated from the already-stored exam score (used by the table’s “Exam %” column) instead of recalculating with a new random modifier.
Changes:
- Update interview notes generation to format exam results using
Person.getPerformanceExamScore()(stored value) rather than re-rolling. - Add a new
Reasoning.getExamResults(int)overload to format text from a supplied score, and deprecate the randomized no-arg variant.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| MekHQ/src/mekhq/campaign/randomEvents/personalities/PersonalityController.java | Uses the stored performance exam score when generating interview notes so UI values match. |
| MekHQ/src/mekhq/campaign/randomEvents/personalities/enums/Reasoning.java | Adds a deterministic formatting overload for exam results and deprecates the randomized method. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Good catch Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
IllianiBird
left a comment
There was a problem hiding this comment.
What a dumb bug, thanks for fixing this
The Personel market shows an 'Exam %' column in the table with all personnel, while the detail pane of an individual person shows an 'Performance Exam' item. These two items refer to the same thing, but the values (almost) never match. The reason is that calculating the value involves a small random up-or-down modifier.
This PR fixes this by using the stored value of the calculation (which is used in the column) to feed to the detail pane, instead of calculating the value a second time.
fixes #8776
NOTE: PR #8909 fixes the seperate issue of the tooltip showing the wrong state that is also mentioned in #8776