[1849] modification to code for variants #11417
Open
+38
−9
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.
Hopefully fixes issues with Variants rules. I'll manually close the bug reports after confirming. (see below)
Before clicking "Create"
master
pins
orarchive_alpha_games
label if this change will break existing gamesdocker compose exec rack rubocop -a
docker compose exec rack rake
Implementation Notes
Explanation of Change
Players trying the variants have all encountered variations of this error at various points:
Often, refreshing and trying again and again seems to resolve the issue temporarily, but that's obviously not a solution. This issue has proven difficult to troubleshoot, since it doesn't happen in Hotseat mode, or even when playing multiplayer on my local environment.
I tried changing the code for def operating_round, removing the logic that gates the inclusion of the variant steps, and instead adding
log_pass
andlog_skip
methods to those steps to mask those steps unless using the variants.Once I did this, rake would fail on the fixture files, which I found interesting since the fixture doesn't use the variants. I went through the logic of the variants themselves, and added a gate to the
def actions
to return [] if that variant isn't active.That resolved the Rake error, and I still seem to be able to play through local games, so at worst this is no worse than the current state, and I think the code is cleaner and closer to the standard code seen throughout the site.
Screenshots
Any Assumptions / Hacks
This may well require archiving/pinning any games using the Bonds/Electric Dreams/Buy Tokens variants, but I don't believe it would affect other games of 1849.