From 9764e4838dcb79279ce99b5916aca12dd5a2b259 Mon Sep 17 00:00:00 2001 From: fred-boy Date: Sat, 24 Nov 2018 23:44:59 +0700 Subject: [PATCH] Fix crash on sand/gravel fall --- core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java index 101ff79..94f6f36 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GamePhysics.java @@ -131,6 +131,7 @@ class GamePhysics { private void playerPhy(Player pl) { pl.pos.y += pl.mov.y; mobYColl(pl); + if (pl.isDead()) return; if (GameItems.isFluid(getBlock(pl.getRect()))) { if (CaveGame.TOUCH && pl.mov.x != 0 && !pl.swim && !pl.flyMode) pl.swim = true; @@ -157,6 +158,7 @@ class GamePhysics { private void mobPhy(Mob mob) { mob.pos.y += mob.mov.y; mobYColl(mob); + if (mob.isDead()) return; if (mob.getType() == 0 && GameItems.isFluid(getBlock(mob.getRect()))) { if (mob.mov.y > 9) mob.mov.add(0, -.9f); -- 2.29.2