Skip to content

Laser - Fix add null-safe guard#11154

Merged
PabstMirror merged 1 commit intoacemod:masterfrom
Kitanagoya5381-ARMA3:Laser-null-safe-guard
Dec 9, 2025
Merged

Laser - Fix add null-safe guard#11154
PabstMirror merged 1 commit intoacemod:masterfrom
Kitanagoya5381-ARMA3:Laser-null-safe-guard

Conversation

@Hotel2622
Copy link
Copy Markdown
Contributor

When merged this pull request will:

  • Add null-safe guard to prevent referencing deleted laser objects after

Descript

This PR fixes an issue where rapidly toggling the ACE laser on/off causes the original laser object to be deleted, while the script still keeps a stale reference.

To prevent this, I added a null-safe guard that checks whether the stored laser object is still valid before using it.

Note

I'm not entirely sure about the root cause of this issue.
It might be related to rendering or the engine’s object update order.
As I'm still a beginner, I addressed it in the simplest way I could by adding a basic safety check.

Before / After Video

Before: https://youtu.be/QutVE1YstEg
After: https://youtu.be/MP3OL_54s8I

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

…rapid toggle

Rapid toggling of the laser caused the original laser object to be deleted
while still being referenced by scripts, resulting in pointing to invalid or
unexpected positions. Added safety checks to ensure the reference is valid
before accessing or updating it, preventing undefined behavior.
@PabstMirror PabstMirror added this to the 3.20.2 milestone Dec 4, 2025
@PabstMirror PabstMirror added the kind/bug-fix Release Notes: **FIXED:** label Dec 4, 2025
@PabstMirror PabstMirror merged commit dd722c0 into acemod:master Dec 9, 2025
3 checks passed
@Hotel2622 Hotel2622 deleted the Laser-null-safe-guard branch December 10, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug-fix Release Notes: **FIXED:**

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants