-
Notifications
You must be signed in to change notification settings - Fork 826
Random spawn. Avoid spawning near water. #3009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Random spawn. Avoid spawning near water. #3009
Conversation
WalkthroughThe changes add validation to spawn tile selection by introducing overloaded function signatures in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| if (!getSpawnTiles(this.mg, tile, true)) { | ||
| // if some of the spawn tile is outside of the land, we want to find another spawn tile | ||
| continue; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean we are doing the check twice? once here and again but without the requireAllValid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we replace the getSpawnTiles with some "isValidSpawnLocation" and update utils to add a new function which basically is a clone of the original getSpawnTiles(), but uses isShore?
Description:
Fixing https://discord.com/channels/1359946986937258015/1360078040222142564/1463898386854973642
Now, if not all tiles on the spawn circle can be owned, the algorithm tries to select another random spawn tile.
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
nikolaj_mykola