mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Fix crash related to ChangeTargets and SA/subSAs without a target. SubAbilities can now have their targets changed
This commit is contained in:
@@ -28,8 +28,15 @@ public class ChangeTargetsEffect extends SpellAbilityEffect {
|
||||
// If there isn't a Stack Instance, there isn't really a target
|
||||
continue;
|
||||
}
|
||||
// Update targets, with a potential new target
|
||||
si.updateTarget(sa.getActivatingPlayer().getController().chooseTargets(tgtSA));
|
||||
|
||||
SpellAbilityStackInstance changingTgtSI = si;
|
||||
while(changingTgtSI != null) {
|
||||
// Update targets, with a potential new target
|
||||
SpellAbility changingTgtSA = changingTgtSI.getSpellAbility();
|
||||
changingTgtSI.updateTarget(sa.getActivatingPlayer().getController().chooseTargets(changingTgtSA));
|
||||
changingTgtSI = changingTgtSI.getSubInstace();
|
||||
}
|
||||
|
||||
if (remember) {
|
||||
sa.getSourceCard().addRemembered(tgtSA.getSourceCard());
|
||||
}
|
||||
|
||||
@@ -416,6 +416,9 @@ public class PlayerControllerHuman extends PlayerController {
|
||||
*/
|
||||
@Override
|
||||
public Target chooseTargets(SpellAbility ability) {
|
||||
if (ability.getTarget() == null) {
|
||||
return null;
|
||||
}
|
||||
Target oldTarget = new Target(ability.getTarget());
|
||||
TargetSelection select = new TargetSelection(ability);
|
||||
ability.getTarget().resetTargets();
|
||||
|
||||
Reference in New Issue
Block a user