AiController: checkETBEffects: make it better working with OverridingAbility (and use better getAbility function)

This commit is contained in:
Hanmac
2016-11-16 06:23:15 +00:00
parent 5ac07c67af
commit e9ddecbc8c

View File

@@ -247,22 +247,20 @@ public class AiController {
continue; continue;
} }
if (tr.getOverridingAbility() != null) {
// Abilities yet
continue;
}
// if trigger is not mandatory - no problem // if trigger is not mandatory - no problem
if (params.get("OptionalDecider") != null && api == null) { if (params.get("OptionalDecider") != null && api == null) {
continue; continue;
} }
// Maybe better considerations SpellAbility exSA = tr.getOverridingAbility();
final String execute = params.get("Execute");
if (execute == null) { if (exSA == null) {
continue; // Maybe better considerations
if (!params.containsKey("Execute")) {
continue;
}
exSA = AbilityFactory.getAbility(card, params.get("Execute"));
} }
final SpellAbility exSA = AbilityFactory.getAbility(card.getSVar(execute), card);
if (api != null) { if (api != null) {
if (exSA.getApi() != api) { if (exSA.getApi() != api) {