diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-31 23:02:33 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-31 23:02:33 +0100 |
commit | 9f2c616e8e7ff11cb3c20aadd71ed429ee88f0d9 (patch) | |
tree | f17b31d1da47600b8891dbf751e24d3bc126d1ec /core/src | |
parent | 80fe0d01b9690a5b302393c96fba72092b43fc2b (diff) | |
download | RustAndDust-9f2c616e8e7ff11cb3c20aadd71ed429ee88f0d9.zip RustAndDust-9f2c616e8e7ff11cb3c20aadd71ed429ee88f0d9.tar.gz |
StateCommon: accept touch on OFFMAP Hex, but do not highlight them
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateCommon.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateCommon.java b/core/src/ch/asynk/tankontank/game/states/StateCommon.java index 9c229b2..abcaae7 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateCommon.java +++ b/core/src/ch/asynk/tankontank/game/states/StateCommon.java @@ -76,15 +76,13 @@ public abstract class StateCommon implements State public boolean downInMap(float x, float y) { downHex = map.getHexAt(x, y); - if (downHex == null) return false; - return !downHex.isOffMap(); + return (downHex != null); } public boolean upInMap(float x, float y) { upHex = map.getHexAt(x, y); - if (upHex == null) return false; - return !upHex.isOffMap(); + return (upHex != null); } protected boolean hasUnit() @@ -96,7 +94,7 @@ public abstract class StateCommon implements State { selectedHex = hex; selectedUnit = selectedHex.getUnit(); - map.selectHex(selectedHex); + if (!hex.isOffMap()) map.selectHex(selectedHex); if (selectedUnit != null) isEnemy = ctrl.player.isEnemy(selectedUnit); else |