From f8876a67f82a7ab1e1ce4ddc0f64f6b6ee78cc58 Mon Sep 17 00:00:00 2001 From: Sesu8642 <45859254+Sesu8642@users.noreply.github.com> Date: Fri, 29 Sep 2023 22:02:53 +0200 Subject: [PATCH] fix ability to dispose unit using longpress shortcut to buy castle while holding it fixes #66 --- .../feudaltactics/lib/gamestate/InputValidationHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/main/java/de/sesu8642/feudaltactics/lib/gamestate/InputValidationHelper.java b/core/src/main/java/de/sesu8642/feudaltactics/lib/gamestate/InputValidationHelper.java index 1b658e84..6012978a 100644 --- a/core/src/main/java/de/sesu8642/feudaltactics/lib/gamestate/InputValidationHelper.java +++ b/core/src/main/java/de/sesu8642/feudaltactics/lib/gamestate/InputValidationHelper.java @@ -179,6 +179,9 @@ public static boolean checkBuyAndPlaceCastleInstantly(GameState gameState, Playe if (activeKingdom.getSavings() < Castle.COST) { return false; } + if (gameState.getHeldObject() != null) { + return false; + } // then check whether placing is possible if (isWater(tile)) { return false;