Laser - Fix add null-safe guard#11154
Merged
PabstMirror merged 1 commit intoacemod:masterfrom Dec 9, 2025
Merged
Conversation
…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
reviewed
Dec 4, 2025
PabstMirror
approved these changes
Dec 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When merged this pull request will:
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
Component - Add|Fix|Improve|Change|Make|Remove {changes}.