From baff2a548617ea807d5285da65589dbb87a5f09c Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Tue, 5 Oct 2021 07:04:43 +0300 Subject: [PATCH] - Minor change to the code. --- forge-ai/src/main/java/forge/ai/ability/FightAi.java | 9 +++++---- forge-gui-mobile-dev/src/forge/app/Main.java | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/FightAi.java b/forge-ai/src/main/java/forge/ai/ability/FightAi.java index b509f31a87c..e065c168cf6 100644 --- a/forge-ai/src/main/java/forge/ai/ability/FightAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/FightAi.java @@ -60,13 +60,14 @@ public class FightAi extends SpellAbilityAi { // assumes the triggered card belongs to the ai if (sa.hasParam("Defined")) { CardCollection fighter1List = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa); - if (fighter1List.isEmpty()) { - if ("ChosenAsTgt".equals(sa.getParam("AILogic")) && sa.getRootAbility().getTargetCard() != null) { + if ("ChosenAsTgt".equals(sa.getParam("AILogic")) && sa.getRootAbility().getTargetCard() != null) { + if (fighter1List.isEmpty()) { fighter1List.add(sa.getRootAbility().getTargetCard()); - } else { - return true; // FIXME: shouldn't this return "false" if nothing found? } } + if (fighter1List.isEmpty()) { + return true; // FIXME: shouldn't this return "false" if nothing found? + } Card fighter1 = fighter1List.get(0); for (Card humanCreature : humCreatures) { if (ComputerUtilCombat.getDamageToKill(humanCreature) <= fighter1.getNetPower() diff --git a/forge-gui-mobile-dev/src/forge/app/Main.java b/forge-gui-mobile-dev/src/forge/app/Main.java index 7b84b004902..e0050660afd 100644 --- a/forge-gui-mobile-dev/src/forge/app/Main.java +++ b/forge-gui-mobile-dev/src/forge/app/Main.java @@ -55,12 +55,12 @@ public class Main { } // Set this to "true" to make the mobile game port run as a full-screen desktop application - boolean desktopMode = cmd.hasOption("fullscreen"); + boolean desktopMode = true;//cmd.hasOption("fullscreen"); // Set this to the location where you want the mobile game port to look for assets when working as a full-screen desktop application // (uncomment the bottom version and comment the top one to load the res folder from the current folder the .jar is in if you would // like to make the game load from a desktop game folder configuration). - String desktopModeAssetsDir = "../forge-gui/"; - //String desktopModeAssetsDir = "./"; + //String desktopModeAssetsDir = "../forge-gui/"; + String desktopModeAssetsDir = "./"; // Assets directory used when the game fully emulates smartphone/tablet mode (desktopMode = false), useful when debugging from IDE String assetsDir = AssetsDownloader.SHARE_DESKTOP_ASSETS ? "../forge-gui/" : "testAssets/"; @@ -154,12 +154,14 @@ public class Main { public void restart() { if (RestartUtil.prepareForRestart()) { Gdx.app.exit(); + System.exit(0); } } @Override public void exit() { Gdx.app.exit(); //can just use Gdx.app.exit for desktop + System.exit(0); } @Override