Remove sparks from lightning - #5396
Conversation
Removes sparking from lightning
|
i want to do just a bit more testing to make sure this works, sparks didnt happen 100% of the time in live server test |
📝 WalkthroughWalkthroughChangesLightning sparking behavior
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 8✅ Passed checks (8 passed)
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 `@Content.Server/Tesla/EntitySystem/LightningSparkingSystem.cs`:
- Around line 25-27: Update the sparking-disable logic around
LightningSparkingSystem’s appearance update so TeslaCoilVisuals.Lightning is
cleared when IsSparking is set to false. Preserve the existing timing assignment
and ensure Update retains a cleanup path rather than leaving the lightning
appearance enabled indefinitely.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 36f18b4c-7109-4574-b04c-b142417b3f59
📒 Files selected for processing (1)
Content.Server/Tesla/EntitySystem/LightningSparkingSystem.cs
| _appearance.SetData(uid.Owner, TeslaCoilVisuals.Lightning, true); | ||
| uid.Comp.LightningEndTime = _gameTiming.CurTime + TimeSpan.FromSeconds(uid.Comp.LightningTime); | ||
| uid.Comp.IsSparking = true; | ||
| uid.Comp.IsSparking = false; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Clear the lightning appearance when disabling sparking.
Nice targeted change toward preventing lightning-induced ignition, but Line 25 still enables the lightning appearance while Line 27 makes Update skip the cleanup path. After the first hit, TeslaCoilVisuals.Lightning can remain enabled indefinitely. Set the appearance to false here, or otherwise preserve a cleanup path.
Proposed fix
- _appearance.SetData(uid.Owner, TeslaCoilVisuals.Lightning, true);
+ _appearance.SetData(uid.Owner, TeslaCoilVisuals.Lightning, false);
uid.Comp.LightningEndTime = _gameTiming.CurTime + TimeSpan.FromSeconds(uid.Comp.LightningTime);
uid.Comp.IsSparking = false;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| _appearance.SetData(uid.Owner, TeslaCoilVisuals.Lightning, true); | |
| uid.Comp.LightningEndTime = _gameTiming.CurTime + TimeSpan.FromSeconds(uid.Comp.LightningTime); | |
| uid.Comp.IsSparking = true; | |
| uid.Comp.IsSparking = false; | |
| _appearance.SetData(uid.Owner, TeslaCoilVisuals.Lightning, false); | |
| uid.Comp.LightningEndTime = _gameTiming.CurTime + TimeSpan.FromSeconds(uid.Comp.LightningTime); | |
| uid.Comp.IsSparking = false; |
🤖 Prompt for 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.
In `@Content.Server/Tesla/EntitySystem/LightningSparkingSystem.cs` around lines 25
- 27, Update the sparking-disable logic around LightningSparkingSystem’s
appearance update so TeslaCoilVisuals.Lightning is cleared when IsSparking is
set to false. Preserve the existing timing assignment and ensure Update retains
a cleanup path rather than leaving the lightning appearance enabled
indefinitely.
Removes sparking from lightning
Short description
Removes sparking from lightning due to supermatter interaction
Why we need to add this
Supermatter will ignite its tritium when striking entities. (can maybe be re-enabled if it can be moved to the entity being struck instead).
Checks
Changelog
🆑 Swonki