diff --git a/projects/mtg/src/AIPlayer.cpp b/projects/mtg/src/AIPlayer.cpp index e1e233d41..dd27c3cbb 100644 --- a/projects/mtg/src/AIPlayer.cpp +++ b/projects/mtg/src/AIPlayer.cpp @@ -429,12 +429,6 @@ int AIAction::getEfficiency() efficiency = 10; MTGCardInstance * _target = (MTGCardInstance *) (a->target); //ensuring that Ai grants abilities to creatures during first main, so it can actually use them in combat. - if (_target && !_target->has(a->abilitygranted) && g->getCurrentGamePhase() == Constants::MTG_PHASE_FIRSTMAIN) - { - //trying to avoid Ai giving ie:flying creatures ie:flying twice. - efficiency += (15 * _target->DangerRanking()); - - } if (target) { AbilityFactory af; @@ -446,10 +440,20 @@ int AIAction::getEfficiency() efficiency = 0; //stop giving trample to the players creatures. } - if (suggestion == BAKA_EFFECT_BAD && p != target->controller() && target->has(a->abilitygranted)) + if (suggestion == BAKA_EFFECT_BAD && p != _target->controller() && _target->has(a->abilitygranted)) { efficiency += (15 * _target->DangerRanking()); - } + } + if (_target && !_target->has(a->abilitygranted) && g->getCurrentGamePhase() == Constants::MTG_PHASE_FIRSTMAIN) + { + efficiency += (15 * _target->DangerRanking()); + + } + if (_target && _target->has(a->abilitygranted)) + { + //trying to avoid Ai giving ie:flying creatures ie:flying twice. + efficiency = 0; + } } break; }