ihyajb
November 29, 2023, 1:05am
1
WARNING
If you post here without knowing what you’re doing you’ll most likely get suspended, you should probably post in client-support instead.
Description: Was first reported in the discord by user “royaltheone”. But using the native SetArtificialLightsState
sometimes crashes
Server artifact version: 7037
Expected behavior: It wont crash the player
Current behavior: Crashed Player
Error screenshot:
.dmp/crash files:
CfxCrashDump_2023_11_29_00_55_39.zip (2.3 MB)
Files/Code to reproduce bug:
RegisterCommand("lightON", function (source, args)
SetArtificialLightsState(false)
end)
RegisterCommand("lightOFF", function (source, args)
SetArtificialLightsState(true)
end)
Extra information: N/A
Disquse
January 12, 2024, 12:51am
2
I guess it’s finally the time to fix it. Will be investigated shortly.
Here’s a PR that meant to fix this issue.
citizenfx:master
← Disquse:redm/artificial-lights-crash
opened 02:29AM - 16 Jan 24 UTC
### Goal of this PR
This PR is intended to fix a crash that randomly occurs a… fter using the `SET_ARTIFICIAL_LIGHTS_STATE` native in RedM. A more detailed technical explanation can be found in the code.
...
### How is this PR achieving the goal
By patching a function that is causing the crash.
...
### This PR applies to the following area(s)
RedM
...
### Successfully tested on
**Game builds:** 1311, 1355, 1436, 1491
**Platforms:** Windows
### Checklist
- [x] Code compiles and has been tested successfully.
- [x] Code explains itself well and/or is documented.
- [x] My commit message explains what the changes do and what they are for.
- [x] No extra compilation warnings are added by these changes.
### Fixes issues
Fixes an issue reported here: https://forum.cfx.re/t/setartificiallightsstate-crash/5188901
3 Likes