Skip to content

Comments

Fix/unit movement#893

Open
stavrosfa wants to merge 3 commits intoC7-Game:Developmentfrom
stavrosfa:fix/unit-movement
Open

Fix/unit movement#893
stavrosfa wants to merge 3 commits intoC7-Game:Developmentfrom
stavrosfa:fix/unit-movement

Conversation

@stavrosfa
Copy link
Contributor

@stavrosfa stavrosfa commented Feb 19, 2026

I think the bug was two-fold.

First all the issues after many many replays, seems to be that non combat units (Worker, Scout, Settler) tried to enter a tile where there was either a Barbarian or a Barbarian camp. The camps weren't accounted for.

Secondly, there were 2 early returns, but they weren't dependant on HasHostileCity() or HasHostileUnits() but rather, whether we raised a notice to the player.

If you have any ideas on how we could unit test this effectively, let me know.

Right now I have tested this just by playing 10-15 games in a row in observer mode for 100 turns each, and I didn't crash. Previously every 3-4 games max, I had this issue.

@stavrosfa
Copy link
Contributor Author

stavrosfa commented Feb 19, 2026

I condensed the different options down to the 4 distinct cases we have, with somewhat more clear names.

I used this during my investigation for the bug to make it easier to understand at a glance what each probe does, seemed like a good thing to have overall.

@stavrosfa stavrosfa requested a review from esbudylin February 21, 2026 16:19
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