Fixes auto assigning forces to official challenge scenarios (#8612)#8811
Open
VicenteCartas wants to merge 2 commits intoMegaMek:mainfrom
Open
Fixes auto assigning forces to official challenge scenarios (#8612)#8811VicenteCartas wants to merge 2 commits intoMegaMek:mainfrom
VicenteCartas wants to merge 2 commits intoMegaMek:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts StratCon force auto-assignment behavior so Official Challenge scenarios don’t forcibly pre-select/assign a player force, addressing #8612 in the StratCon scenario generation/deployment flow.
Changes:
- Prevent auto-assignment for Official Challenge scenarios when generating scenarios for existing forces.
- Prevent auto-assignment when deploying a force onto a hex that already contains an Official Challenge scenario.
- Add unit tests covering
deployForceToCoords()behavior for challenge vs non-challenge scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| MekHQ/src/mekhq/campaign/stratCon/StratConRulesManager.java | Adds Official Challenge checks to bypass auto-assignment paths in scenario generation/deployment. |
| MekHQ/unittests/mekhq/campaign/stratCon/StratConRulesManagerTest.java | Adds regression tests asserting forces are not auto-assigned to Official Challenge scenarios (and still are for normal scenarios). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8811 +/- ##
============================================
+ Coverage 13.22% 13.27% +0.04%
- Complexity 7874 7893 +19
============================================
Files 1306 1306
Lines 169191 169193 +2
Branches 25458 25460 +2
============================================
+ Hits 22383 22459 +76
+ Misses 144632 144535 -97
- Partials 2176 2199 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
This fixes #8612
I couldn't repro manually, but the test will check that a force is not auto-assigned to an official challenge scenario. Without this change, this is the test result, where stratcon tries to auto-assign the foce:
With the change, this test passes correctly.