From: fred-boy Date: Sat, 24 Nov 2018 16:44:59 +0000 (+0700) Subject: Fix crash on sand/gravel fall X-Git-Tag: alpha0.4~71 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=9764e4838dcb79279ce99b5916aca12dd5a2b259;p=cavedroid.git Fix crash on sand/gravel fall --- 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);