Open
Conversation
…d on barbarians/barbarian camps
esbudylin
approved these changes
Feb 19, 2026
Contributor
Author
|
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. |
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.
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.