Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private void OnHitByLightning(Entity<LightningSparkingComponent> uid, ref HitByL
{
_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;
Comment on lines 25 to +27

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.

🎯 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.

Suggested change
_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.

}

public override void Update(float frameTime)
Expand Down
Loading