- 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
public TargetChoices chooseNewTargetsFor(SpellAbility ability) {
if (ability.getTargetRestrictions() == null) {
SpellAbility sa = ability.isWrapper() ? ((WrappedAbility) ability).getWrappedAbility() : ability;
if (sa.getTargetRestrictions() == null) {
return null;
}
TargetChoices oldTarget = ability.getTargets();
TargetSelection select = new TargetSelection(ability);
ability.resetTargets();
TargetChoices oldTarget = sa.getTargets();
TargetSelection select = new TargetSelection(sa);
sa.resetTargets();
if (select.chooseTargets(oldTarget.getNumTargeted())) {
return ability.getTargets();
return sa.getTargets();
}
else {
// Return old target, since we had to reset them above