Lamp Causes Light Leak Through Hatches After Open & Close
Disclaimers
- [X] I have searched the issue tracker to check if the issue has already been reported.
- [ ] My issue happened while using mods.
What happened?
The lamp, when you open and close a hatch with buttons, the light will keep shining through the hatch even when it's closed. Example: Room is somewhat lit, you open the hatch with buttons, now the room is brighter, close the hatch and the room stays lit
https://github.com/Regalis11/Barotrauma/assets/20964160/46a4eb3d-208b-42e7-8de8-c374e7ea4892
Reproduction steps
Shown in video
Bug prevalence
Happens every time I play
Version
v1.0.13.2
-
No response
Which operating system did you encounter this bug on?
Windows
Relevant error messages and crash reports
Thank you for the report!
I gave this a test, and it seems to be caused by how the lighting system marks convex hulls (things that cast shadows) as "hidden" from the light's point of view if they're behind a wall or an obstacle. The issue here is the door goes behind the floor structure when it's closing, marking it as "hidden", and the light will ignore it from that point onwards. Need to think a bit about a way to address this (forcing the door to become "unhidden" for all lights whenever it opens/closes wouldn't be ideal, because it'd significantly increase the amount of light calculations and be bad for performance).
Fixed in https://github.com/FakeFishGames/Barotrauma-development/commit/ade16256ada67b560899b7f26a639b002a37a401
Closing as tested and merged for the next patch/unstable.