- Attempt to fix changing targets of wrapped abilities

This commit is contained in:
swordshine
2014-05-07 14:04:49 +00:00
parent dad0b7821b
commit 7a4a562562

View File

@@ -506,14 +506,15 @@ public class PlayerControllerHuman extends PlayerController {
*/ */
@Override @Override
public TargetChoices chooseNewTargetsFor(SpellAbility ability) { public TargetChoices chooseNewTargetsFor(SpellAbility ability) {
if (ability.getTargetRestrictions() == null) { SpellAbility sa = ability.isWrapper() ? ((WrappedAbility) ability).getWrappedAbility() : ability;
if (sa.getTargetRestrictions() == null) {
return null; return null;
} }
TargetChoices oldTarget = ability.getTargets(); TargetChoices oldTarget = sa.getTargets();
TargetSelection select = new TargetSelection(ability); TargetSelection select = new TargetSelection(sa);
ability.resetTargets(); sa.resetTargets();
if (select.chooseTargets(oldTarget.getNumTargeted())) { if (select.chooseTargets(oldTarget.getNumTargeted())) {
return ability.getTargets(); return sa.getTargets();
} }
else { else {
// Return old target, since we had to reset them above // Return old target, since we had to reset them above