-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bxt_lightstyle #92
Conversation
I have had some weirdly random crashes at map startup while testing on Windows but I am not sure if this is the cause as I don't see any backtrace. Might as well attribute it to WINE. After 5 minutes of restarting the game, it just stopped. Might be nothing but it might be something in the future if we want to see where to point our fingers at. |
I did a more testing and I see that a named light won't be overridden by this. But general lighting would be affected. |
src/modules/lightstyle.rs
Outdated
let cl_lightstyle = &mut unsafe { *engine::cl_lightstyle.get(marker) }; | ||
|
||
// More often a map's default lightstyle will be empty. | ||
*ORIGINAL_LIGHTSTYLE.borrow_mut(marker) = cl_lightstyle[0].map.to_vec(); | ||
apply_from_cvars(marker); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is holding a &mut
reference on lightstyle while it is modified in apply_from_cvars
, which is UB. Limit the scope of the &mut
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting.
Thanks |
aka night vision
No need for mat_fullbright 1 and -75% fps if use this one instead. No need for tweaking gamma and brightness either. Most importantly, no need to restart the map.