From: fredboy Date: Sun, 14 Apr 2024 20:15:42 +0000 (+0700) Subject: Fix blocks at x=0 not selectable by mouse X-Git-Tag: alpha0.4.1~6 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=a3995aab81fddd3ca6960b3ce24d2371eb00ef23;p=cavedroid.git Fix blocks at x=0 not selectable by mouse --- diff --git a/core/src/ru/deadsoftware/cavedroid/game/GameInput.java b/core/src/ru/deadsoftware/cavedroid/game/GameInput.java index 09a7e70..2376bb1 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/GameInput.java +++ b/core/src/ru/deadsoftware/cavedroid/game/GameInput.java @@ -164,12 +164,13 @@ public class GameInput { mCurX += mPlayer.looksLeft() ? 1 : -1; } } else if (!mMainConfig.isTouch()) { - mCurX = (int) (Gdx.input.getX() * (mMainConfig.getWidth() / - Gdx.graphics.getWidth()) + gameRenderer.getCamX()) / 16; + final int tmpX = (int) (Gdx.input.getX() * (mMainConfig.getWidth() / + Gdx.graphics.getWidth()) + gameRenderer.getCamX()); + mCurX = tmpX / 16; mCurY = (int) (Gdx.input.getY() * (mMainConfig.getHeight() / Gdx.graphics.getHeight()) + gameRenderer.getCamY()) / 16; - if (mCurX < 0) { + if (tmpX < 0) { mCurX--; } }