Skip to content

fix: block road extension through opponent's settlement endpoint#377

Open
broussal wants to merge 2 commits into
bcollazo:mainfrom
broussal:main
Open

fix: block road extension through opponent's settlement endpoint#377
broussal wants to merge 2 commits into
bcollazo:mainfrom
broussal:main

Conversation

@broussal

@broussal broussal commented Jun 7, 2026

Copy link
Copy Markdown

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.

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.
@netlify

netlify Bot commented Jun 7, 2026

Copy link
Copy Markdown

👷 Deploy request for catanatron-staging pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 84d6dca

@bcollazo

bcollazo commented Jun 7, 2026

Copy link
Copy Markdown
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.
@broussal

Copy link
Copy Markdown
Author

Okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants