From 5b23cc2e335250e0b6f368d8e59e2b33ff551d99 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Tue, 7 Feb 2017 13:10:58 +0800 Subject: [PATCH] auto close --- projects/mtg/src/MTGAbility.cpp | 13 +------------ projects/mtg/src/TargetChooser.cpp | 5 +++++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index c4688b2bf..15287c569 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -3638,18 +3638,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG a->oneShot = 1; a->canBeInterrupted = false; a->named = newName; - /***********do nothing***********/ - if((card->controller()->isAI() && - card->controller()->opponent()->isAI())|| - !card->getAICustomCode().size()) - { - MTGAbility * a2 = parseMagicLine("activate donothing", id, spell, card); - a2->oneShot = 1; - a2->canBeInterrupted = false; - return a2; - } - /*******************************/ - else if(card->getAICustomCode().size() && card->controller()->isAI()) + if(card->getAICustomCode().size() && card->controller()->isAI()) { MTGAbility * a3 = parseMagicLine(card->getAICustomCode(), id, spell, card); a3->oneShot = 1; diff --git a/projects/mtg/src/TargetChooser.cpp b/projects/mtg/src/TargetChooser.cpp index 2e72d0680..be0466166 100644 --- a/projects/mtg/src/TargetChooser.cpp +++ b/projects/mtg/src/TargetChooser.cpp @@ -1041,6 +1041,11 @@ int TargetChooser::addTarget(Targetable * target) if (canTarget(target)) { TargetsList::addTarget(target); +#if defined (ANDROID) //auto close... we need to close gui like swipe left... + if (target->getObserver()->guiOpenDisplay && getNbTargets() == maxtargets) + target->getObserver()->ButtonPressed(target->getObserver()->guiOpenDisplay); +#endif//example bug, cast Snapcaster Mage during a spell of opponent and target a Mana Leak.. + //how can you cast the Mana Leak? If you can't close the graveyard window to tap for mana??? } return targetsReadyCheck();