Skip to content

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

Merged
lL1l1 merged 10 commits into
FAForever:developfrom
NoryGit:zeus_fix
May 8, 2026
Merged

URA0103: resolve lingering bomb issue; fix failure to destroy on water impact#7077
lL1l1 merged 10 commits into
FAForever: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 to remove 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 a changelog snippet describing these fixes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 1, 2026

Warning

Rate limit exceeded

@lL1l1 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 37 minutes and 37 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c2e7006c-a4e7-4c42-ab25-773fdb971bda

📥 Commits

Reviewing files that changed from the base of the PR and between efb017e and 13fcdb2.

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

Walkthrough

CNeutronClusterBombProjectile now forks a failsafe destroy thread on create and marks Impacted on first impact for any target; fragment spawning/velocity assignment is skipped for targetType == 'Air'. CIFNeutronClusterBomb02 blueprint adds DestroyOnWater = true. Small docs/comments updated and a changelog snippet added.

Changes

Neutron cluster projectile behavior & config

Layer / File(s) Summary
Data / Constants
projectiles/CIFNeutronClusterBomb02/CIFNeutronClusterBomb02_proj.bp
Added DestroyOnWater = true to the projectile Physics blueprint.
Core Implementation
lua/cybranprojectiles.lua
Added FailsafeDestroyThread (waits 120 ticks then destroys if not already); OnCreate forks this thread and adds it to Trash.
Impact Handling / Fragment Logic
lua/cybranprojectiles.lua
OnImpact now sets self.Impacted = true on first impact regardless of targetType; child fragment creation and SetVelocity calls are executed only when targetType ~= 'Air' (refactored to use a local child reference).
Tests / Changelog / Docs
changelog/snippets/fix.7077.md, engine/Core/Blueprints/ProjectileBlueprint.lua, engine/Enums.lua
Added changelog snippet; updated ProjectileBlueprintPhysics.Lifetime doc comment to note default 15s; added inline comments to ImpactType entries for Air and Underwater explaining end-of-lifetime causes.

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, area: engine

Suggested reviewers

  • lL1l1
  • BlackYps
  • speed2CZ

Poem

🐰 I tunneled through code where the fragments sleep,

A failsafe counts ticks while the battlefield keeps.
When air meets sky, the children wait still,
Water now swallows the bombs by will.
Hop, patch, and chew — the fix is neat and sweet.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the two main fixes: resolving the lingering bomb issue and fixing failure to destroy on water impact, matching the core changes in the changeset.
Description check ✅ Passed The description covers the two main issues being fixed with supporting context, includes a changelog snippet, and has most checklist items completed, though reviewer assignment is pending.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

Comment thread lua/cybranprojectiles.lua Outdated
Comment thread lua/cybranprojectiles.lua Outdated
OnCreate = function(self)
SinglePolyTrailProjectile.OnCreate(self)
self.Impacted = false
self.Trash:Add(ForkThread(self.FailsafeDestroyThread, self))
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.

This should never be necessary, the engine gives projectiles a lifetime which will destroy it the same way.

Comment thread lua/cybranprojectiles.lua Outdated
Comment on lines +494 to +504
if self.Impacted == false and targetType ~= 'Air' then
if self.Impacted == false then
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.

an Air impact type occurs when the projectile is in the air and runs out of lifetime. The original OnImpact should destroy the projectile. So previously there was somehow an air collision type which meant the projectile never destroyed itself, and permanently stopped running the collision script with Impacted set to true, so it just stayed around forever.

Copy link
Copy Markdown
Contributor

@lL1l1 lL1l1 May 8, 2026

Choose a reason for hiding this comment

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

I made a mistake in this explanation assuming that OnImpact always destroys the projectile. If the target entity does not allow collisions then OnImpact returns early. Units stop allowing collisions after they die. This leads to a much more reasonable explanation of the bomb impacting an engi directly, but that engi died to earlier bombs in the cluster, so Impacted is set to true, but Destroy is not called.

@lL1l1 lL1l1 merged commit ca1e735 into FAForever:develop May 8, 2026
5 checks passed
@NoryGit NoryGit deleted the zeus_fix branch May 8, 2026 21:58
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.

3 participants