mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Attempt to fix changing targets of wrapped abilities
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user