mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -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) {
|
||||
val index = z shl 4 or x
|
||||
val currentLight = light[index].toInt() and SectionLight.SKY_LIGHT_MASK shl 4
|
||||
if (currentLight >= nextLevel) {
|
||||
val light = light[index].toInt()
|
||||
if ((light and SectionLight.SKY_LIGHT_MASK shr 4) >= nextLevel) {
|
||||
// light is already higher, no need to trace
|
||||
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) {
|
||||
update = true
|
||||
}
|
||||
|
||||
|
||||
if (nextLevel == 1) {
|
||||
if (nextLevel <= 1) {
|
||||
return updateY()
|
||||
}
|
||||
val neighbourLevel = nextLevel - 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user