diff --git a/build.gradle.kts b/build.gradle.kts index 7d6c6f61..ba812533 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -80,8 +80,8 @@ dependencies { implementation("net.java.dev.jna:jna:5.13.0") implementation("com.github.jnr:jnr-ffi:2.2.13") - implementation("ru.dbotthepony:kbox2d:2.4.1.2") - implementation("ru.dbotthepony:kvector:2.2.4") + implementation("ru.dbotthepony:kbox2d:2.4.1.6") + implementation("ru.dbotthepony:kvector:2.2.8") implementation("com.github.ben-manes.caffeine:caffeine:3.1.5") } diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLShaderProgram.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLShaderProgram.kt index e811e8bd..c917278e 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLShaderProgram.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/client/gl/shader/GLShaderProgram.kt @@ -196,7 +196,7 @@ open class GLShaderProgram(val state: GLStateTracker, shaders: Iterable, This : Chunk, This : Chunk = TwoDimensionalArray(CHUNK_SIZE, CHUNK_SIZE) + protected val liquidStates: Object2DArray = Object2DArray.nulls(CHUNK_SIZE, CHUNK_SIZE) fun getLiquid(x: Int, y: Int) = liquidStates[x, y] fun setLiquid(x: Int, y: Int, value: LiquidDefinition?): LiquidState? { if (value == null) { - val old = liquidStates.set(x, y, null) - - if (old != null) { - changeset++ - liquidChangeset++ - } - - return old + liquidStates.set(x, y, null) + changeset++ + liquidChangeset++ + return null } val state = LiquidState(value)