mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
fix #12006 (NthTargetPointer error on TargetAdjuster)
This commit is contained in:
parent
ea843c1bb9
commit
b1f83d1f9e
1 changed files with 3 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ public abstract class NthTargetPointer extends TargetPointerImpl {
|
|||
private final Map<UUID, Integer> zoneChangeCounter = new HashMap<>();
|
||||
private final int targetIndex; // zero-based target numbers (1 -> 0, 2 -> 1, 3 -> 2, etc)
|
||||
|
||||
public NthTargetPointer(int targetNumber) {
|
||||
protected NthTargetPointer(int targetNumber) {
|
||||
super();
|
||||
this.targetIndex = targetNumber - 1;
|
||||
}
|
||||
|
|
@ -53,8 +53,9 @@ public abstract class NthTargetPointer extends TargetPointerImpl {
|
|||
}
|
||||
|
||||
private void wrongTargetsUsage(Ability source) {
|
||||
if (this.targetIndex > 0) {
|
||||
if (this.targetIndex > 0 && source.getTargetAdjuster() == null) {
|
||||
// first target pointer is default, so must be ignored
|
||||
// also legitimate use case with target adjuster e.g. Jilt
|
||||
throw new IllegalStateException("Wrong code usage: source ability miss targets setup for target pointer - "
|
||||
+ this.getClass().getSimpleName() + " - " + source.getClass().getSimpleName() + " - " + source);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue