mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-09 01:54:04 +09:00
fix: touching the bottom of the world would crash the game because setFluid did not coerce the coords
This commit is contained in:
@@ -770,6 +770,8 @@ open class GameWorld(
|
|||||||
wallDamages[LandUtil.getBlockAddr(this, x, y)] ?: 0f
|
wallDamages[LandUtil.getBlockAddr(this, x, y)] ?: 0f
|
||||||
|
|
||||||
fun setFluid(x: Int, y: Int, fluidType: ItemID, fill: Float) {
|
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 (!fluidType.isFluid() && fluidType != Block.AIR) throw IllegalArgumentException("Fluid type is not actually fluid: $fluidType")
|
||||||
|
|
||||||
/*if (x == 60 && y == 256) {
|
/*if (x == 60 && y == 256) {
|
||||||
|
|||||||
Reference in New Issue
Block a user