mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-24 05:10:42 -04:00
fix light leaking from outside map (when should be shadow) with adv lighting mesh builder
This commit is contained in:
parent
014959ca7a
commit
69f27c750b
@ -416,8 +416,12 @@ namespace ClassicalSharp {
|
||||
const int xP1_yM1_zP1 = 24, xP1_yCC_zP1 = 25, xP1_yP1_zP1 = 26;
|
||||
|
||||
int Lit(int x, int y, int z, int cIndex) {
|
||||
if (x < 0 || y < 0 || z < 0
|
||||
|| x >= width || y >= height || z >= length) return 7; // all faces lit
|
||||
if (y < 0 || y >= height) return 7; // all faces lit
|
||||
|
||||
// TODO: check sides height (if sides > edges), check if edge block casts a shadow
|
||||
if (x < 0 || z < 0 || x >= width || z >= length) {
|
||||
return y >= edgeLevel ? 7 : y == (edgeLevel - 1) ? 6 : 0;
|
||||
}
|
||||
|
||||
int flags = 0;
|
||||
BlockID block = chunk[cIndex];
|
||||
|
Loading…
x
Reference in New Issue
Block a user