Skip to content

MIRV warheads now spawn well in impassible terrain - #4756

Open
TKTK123456 wants to merge 4 commits into
openfrontio:mainfrom
TKTK123456:impassible-terrain-fix
Open

MIRV warheads now spawn well in impassible terrain#4756
TKTK123456 wants to merge 4 commits into
openfrontio:mainfrom
TKTK123456:impassible-terrain-fix

Conversation

@TKTK123456

Copy link
Copy Markdown
Contributor

Before opening a PR: discuss new features on Discord first, and file bugs or small improvements as issues. You must be assigned to an approved issue — unsolicited PRs will be auto-closed.

Add approved & assigned issue number here:

Resolves #4755

Description:

MIRV warheads now spawn well in impassible terrain

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory

Please put your Discord username so you can be contacted if a bug or regression is found:

tktk1234567

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f37cb82b-8a7b-460d-8c9d-d116601e714b

📥 Commits

Reviewing files that changed from the base of the PR and between 778b977 and c184c74.

📒 Files selected for processing (1)
  • tests/ImpassableTerrain.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/ImpassableTerrain.test.ts

Walkthrough

NukeExecution.tick() now skips impassable-terrain trajectory validation for MIRVWarhead launches. Other nuke types retain the existing validation and launch-abort behavior, with a test covering MIRV launches across an impassable wall.

Changes

MIRV launch handling

Layer / File(s) Summary
Conditional trajectory validation
src/core/execution/NukeExecution.ts, tests/ImpassableTerrain.test.ts
MIRV warheads bypass the impassable-path check, while other nuke launches still deactivate when their trajectory crosses impassable terrain. The test verifies that a MIRV execution remains active across the wall.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: Bugfix

Poem

MIRV crosses the rocky ground,
No early stop, no warning sound.
Other nukes still check the way,
While warheads rise and split away.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the MIRV impassable-terrain fix, even if the wording is a bit awkward.
Description check ✅ Passed The description matches the bug fix and links the related issue number.
Linked Issues check ✅ Passed The code keeps MIRV warheads from being aborted by impassable terrain, which matches issue #4755's expected behavior.
Out of Scope Changes check ✅ Passed The changes are limited to the MIRV terrain fix and a matching test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@src/core/execution/NukeExecution.ts`:
- Around line 194-204: Add regression tests for the impassable-terrain handling
in NukeExecution: verify a MIRVWarhead launched from impassable terrain still
spawns, and a non-MIRV nuke whose path crosses impassable terrain is aborted.
Reuse the existing NukeExecution test setup and assert the relevant active/spawn
outcomes for both cases.
🪄 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 Plus

Run ID: d207dcfa-a983-4b13-935a-0bf0e84c198f

📥 Commits

Reviewing files that changed from the base of the PR and between ad3fcbe and 866851b.

📒 Files selected for processing (1)
  • src/core/execution/NukeExecution.ts

Comment thread src/core/execution/NukeExecution.ts
@github-project-automation github-project-automation Bot moved this from Triage to Development in OpenFront Release Management Jul 28, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/ImpassableTerrain.test.ts`:
- Around line 270-281: Update the MIRV warhead test around NukeExecution to
assert that a tile on the launch-to-target trajectory is impassable, proving the
path crosses the wall rather than only checking the destination. Replace the
stale “Should have been blocked” comment with wording consistent with the
expected active nuke result.
🪄 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 Plus

Run ID: 4f8b77d6-eebb-451d-a557-1818300b7f72

📥 Commits

Reviewing files that changed from the base of the PR and between 866851b and 5123d5a.

📒 Files selected for processing (1)
  • tests/ImpassableTerrain.test.ts

Comment thread tests/ImpassableTerrain.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development

Development

Successfully merging this pull request may close these issues.

MIRV warheads get deleted if they get spawned in in impassible terrain

1 participant