mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 19:35:00 -04:00
border light: fix skylight propagation
This commit is contained in:
parent
cad6fa8d2b
commit
835f62d1f4
@ -107,19 +107,19 @@ class BorderSectionLight(
|
|||||||
|
|
||||||
fun traceSkyIncrease(x: Int, z: Int, nextLevel: Int) {
|
fun traceSkyIncrease(x: Int, z: Int, nextLevel: Int) {
|
||||||
val index = z shl 4 or x
|
val index = z shl 4 or x
|
||||||
val currentLight = light[index].toInt() and SectionLight.SKY_LIGHT_MASK shl 4
|
val light = light[index].toInt()
|
||||||
if (currentLight >= nextLevel) {
|
if ((light and SectionLight.SKY_LIGHT_MASK shr 4) >= nextLevel) {
|
||||||
// light is already higher, no need to trace
|
// light is already higher, no need to trace
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.light[index] = ((this.light[index].toInt() and SectionLight.BLOCK_LIGHT_MASK) or nextLevel).toByte()
|
this.light[index] = ((light and SectionLight.BLOCK_LIGHT_MASK) or (nextLevel shl 4)).toByte()
|
||||||
|
|
||||||
if (!update) {
|
if (!update) {
|
||||||
update = true
|
update = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (nextLevel == 1) {
|
if (nextLevel <= 1) {
|
||||||
return updateY()
|
return updateY()
|
||||||
}
|
}
|
||||||
val neighbourLevel = nextLevel - 1
|
val neighbourLevel = nextLevel - 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user