Fix/warship freezing no path#4151
Conversation
…current water component - Warship rejects new PatrolTile when in a different water component
…fferent water component
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds water-component checks to MoveWarshipExecution: it aborts if the target is not water and skips per-warship patrol updates when the warship's water component differs from the target. A test verifies patrolTile is unchanged when components differ. ChangesWarship water component validation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/Warship.test.ts`:
- Around line 920-950: This test is declared outside the describe("Warship",
...) so it never gets the describe's beforeEach (game and player1 are
undefined); either move this test body into the existing describe("Warship",
...) block so it runs under the same beforeEach, or convert the test to create
its own isolated fixtures by calling the tests/util/Setup.ts helper (setup()) to
obtain a fresh game and player1, then build the Warship via player1.buildUnit,
register WarshipExecution and MoveWarshipExecution, mock
game.getWaterComponent/hasWaterComponent, call executeTicks, and assert
warship.warshipState().patrolTile — reference symbols: describe("Warship"),
setup(), game, player1, player1.buildUnit, WarshipExecution,
MoveWarshipExecution, executeTicks, warship.warshipState().patrolTile.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: bd86dbd9-f3db-4312-9b94-e0c234333168
📒 Files selected for processing (2)
src/core/execution/MoveWarshipExecution.tstests/Warship.test.ts
…ut by CodeRabbitAI
Add approved & assigned issue number here:
Resolves #4113
Description:
Warships now reject the PatrolTile change when the new one is a different water component.
Adds a test ensuring this behavior.
Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
Katokoda