Skip to content

URA0103: resolve lingering bomb issue; fix failure to destroy on water impact#7077

Open
NoryGit wants to merge 3 commits intoFAForever:developfrom
NoryGit:zeus_fix
Open

URA0103: resolve lingering bomb issue; fix failure to destroy on water impact#7077
NoryGit wants to merge 3 commits intoFAForever:developfrom
NoryGit:zeus_fix

Conversation

@NoryGit
Copy link
Copy Markdown
Contributor

@NoryGit NoryGit commented Apr 1, 2026

Description of the proposed changes

Fixes two separate issues:

  1. Bomb projectiles not getting destroyed on water impact (they travel through the water).
  2. Bomb projectiles lingering and eventually falling through the map, thereby perpetually cluttering the screen.

Example of the bomb lingering issue: #26768413 5:50 at the northern rock base.

Checklist

Summary by CodeRabbit

  • Bug Fixes

    • Added a failsafe that removes lingering cluster bomb projectiles after a short delay.
    • Projectiles now mark impact reliably on first hit; fragment spawning only occurs for non-air impacts.
    • A specific neutron cluster bomb variant is now destroyed on water contact.
  • Documentation

    • Added changelog snippet describing these fixes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 61cc9df0-6ab3-4e2d-940a-afa53d6ec50b

📥 Commits

Reviewing files that changed from the base of the PR and between d16aad5 and 527b994.

📒 Files selected for processing (1)
  • lua/cybranprojectiles.lua

📝 Walkthrough

Walkthrough

CNeutronClusterBombProjectile now forks a failsafe destroy thread on creation and marks Impacted on first impact for any target; fragment spawning is restricted to non-Air targets and refactored to use a local child reference. CIFNeutronClusterBomb02 projectile now destroys on water. A changelog snippet was added.

Changes

Cohort / File(s) Summary
Projectile Lua Logic
lua/cybranprojectiles.lua
Added FailsafeDestroyThread and forked it in OnCreate; OnImpact sets self.Impacted on first impact regardless of targetType; fragment/child creation preserved but velocity assignment is guarded so fragments are spawned/given velocity only when targetType ~= 'Air' (refactored to use a local child reference).
Projectile Physics Configuration
projectiles/CIFNeutronClusterBomb02/CIFNeutronClusterBomb02_proj.bp
Added DestroyOnWater = true to the projectile Physics blueprint.
Changelog
changelog/snippets/fix.7077.md
Added release-note snippet describing fixes for lingering bombs and water-impact destruction.

Sequence Diagram(s)

sequenceDiagram
    actor Launcher
    participant Projectile
    participant FailsafeThread
    participant World
    participant Fragment

    Launcher->>Projectile: spawn()
    Projectile->>FailsafeThread: Fork(FailsafeDestroyThread)
    Note right of FailsafeThread: waits 120 ticks
    World->>Projectile: OnImpact(targetType)
    Projectile->>Projectile: if not Impacted -> set Impacted = true
    alt targetType != "Air"
        Projectile->>Fragment: Create child fragments
        Fragment->>World: SetVelocity / simulate
    end
    FailsafeThread-->>Projectile: if not destroyed -> Destroy()
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

type: bug, area: sim

Suggested reviewers

  • BlackYps
  • lL1l1
  • 4z0t

Poem

🐰 I hopped through code with ears alert and bright,

A failsafe snoozes till it wakes at night.
Fragments only scatter when the target's not air,
Water swallows bombs now — tidy and fair.
Hop, patch, deploy — I nibble bugs with delight.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: resolving the lingering bomb issue and fixing failure to destroy on water impact.
Description check ✅ Passed The description covers the main changes and includes a changelog snippet, but omits the step to request 2-3 reviewers as noted in the checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
lua/cybranprojectiles.lua (1)

517-523: Optional: compact fragment velocity definitions into a table-driven loop.

This block is correct, but converting the velocity tuples to a list and iterating would reduce repetition and make future tuning safer.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lua/cybranprojectiles.lua` around lines 517 - 523, The repeated
SpawnFragment(...) calls should be replaced by a table-driven loop: create a
local table of velocity tuples (each entry containing the three Random(...)
expressions used now), then iterate over that table and call SpawnFragment(v[1],
v[2], v[3]) for each entry; update the block around the SpawnFragment calls in
lua/cybranprojectiles.lua (referencing the SpawnFragment function and the
Random(...) expressions) so tuning only requires editing the tuple list rather
than duplicating calls.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@lua/cybranprojectiles.lua`:
- Around line 517-523: The repeated SpawnFragment(...) calls should be replaced
by a table-driven loop: create a local table of velocity tuples (each entry
containing the three Random(...) expressions used now), then iterate over that
table and call SpawnFragment(v[1], v[2], v[3]) for each entry; update the block
around the SpawnFragment calls in lua/cybranprojectiles.lua (referencing the
SpawnFragment function and the Random(...) expressions) so tuning only requires
editing the tuple list rather than duplicating calls.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6af72121-f5a1-4522-82df-9ff3b996da8e

📥 Commits

Reviewing files that changed from the base of the PR and between 132476b and 29dc8ed.

📒 Files selected for processing (2)
  • lua/cybranprojectiles.lua
  • projectiles/CIFNeutronClusterBomb02/CIFNeutronClusterBomb02_proj.bp

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