URA0103: resolve lingering bomb issue; fix failure to destroy on water impact#7077
URA0103: resolve lingering bomb issue; fix failure to destroy on water impact#7077NoryGit wants to merge 3 commits intoFAForever:developfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughCNeutronClusterBombProjectile now forks a failsafe destroy thread on creation and marks Changes
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()
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
🧹 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
📒 Files selected for processing (2)
lua/cybranprojectiles.luaprojectiles/CIFNeutronClusterBomb02/CIFNeutronClusterBomb02_proj.bp
Description of the proposed changes
Fixes two separate issues:
Example of the bomb lingering issue: #26768413 5:50 at the northern rock base.
Checklist
Summary by CodeRabbit
Bug Fixes
Documentation