Fixes light going through walls

Fixes #2788
Merge pull request #5972 from Razharas/Light

Fixes light going through walls