[cavedroid.git] / core / src / ru / deadsoftware / cavedroid / game / actions / updateblock / UpdateSandAction.kt
diff --git a/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateSandAction.kt b/core/src/ru/deadsoftware/cavedroid/game/actions/updateblock/UpdateSandAction.kt
index 26fb97827c6ed30898977232e0496828bbd201a4..4a2b58e885c42fdbda8c71fadea87c2c065d4628 100644 (file)
) : IUpdateBlockAction {
override fun update(x: Int, y: Int) {
) : IUpdateBlockAction {
override fun update(x: Int, y: Int) {
- val shouldFall = gameWorld.getForeMapBlock(x, y + 1).collision.not()
+ val shouldFall = gameWorld.getForeMap(x, y + 1).params.hasCollision.not()
if (shouldFall) {
if (shouldFall) {
- gameWorld.setForeMap(x, y, 0)
- mobsController.addMob(FallingSand(x * 16f, y * 16f))
+ gameWorld.resetForeMap(x, y)
+ FallingSand(x * 16f, y * 16f)
+ .apply { attachToController(mobsController) }
}
}
}
}