fix: touching the bottom of the world would crash the game because setFluid did not coerce the coords

This commit is contained in:
minjaesong
2024-08-26 01:47:41 +09:00
parent 63322321ce
commit feed1ee6c0

View File

@@ -770,6 +770,8 @@ open class GameWorld(
wallDamages[LandUtil.getBlockAddr(this, x, y)] ?: 0f
fun setFluid(x: Int, y: Int, fluidType: ItemID, fill: Float) {
val (x, y) = coerceXY(x, y)
if (!fluidType.isFluid() && fluidType != Block.AIR) throw IllegalArgumentException("Fluid type is not actually fluid: $fluidType")
/*if (x == 60 && y == 256) {