fix: block road extension through opponent's settlement endpoint#377
Open
broussal wants to merge 2 commits into
Open
fix: block road extension through opponent's settlement endpoint#377broussal wants to merge 2 commits into
broussal wants to merge 2 commits into
Conversation
When a settlement is built on a node that is the endpoint of an opponent's road (len == 1), the node was not removed from the opponent's connected components. This allowed the opponent to later build a road from that blocked endpoint, bypassing the "cannot build through a settlement" rule. The len == 2 case (settlement in the middle of a road) was already handled correctly.
👷 Deploy request for catanatron-staging pending review.Visit the deploys page to approve it
|
Owner
|
Hey! Thanks for opening the issue and cooking up the solution. Could you write a unit test that reproduces the issue? I think a good level of abstraction is making sure that if an enemy node is on the way, even if the player has money for it, the "generate actions" logic, doesn't generate the possibility of a road across the enemy node. Thanks! |
Add test to ensure roads cannot extend past enemy settlements.
Author
|
Okay |
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.
When a settlement is built on a node that is the endpoint of an opponent's road (len == 1), the node was not removed from the opponent's connected components. This allowed the opponent to later build a road from that blocked endpoint, bypassing the "cannot build through a settlement" rule.
The len == 2 case (settlement in the middle of a road) was already handled correctly.
See issue #376 for additional details.