mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* Tunnel Ignus - fixed NPE error for AI;
This commit is contained in:
parent
5bf0fd89c2
commit
ea532fef90
1 changed files with 6 additions and 7 deletions
|
@ -1,10 +1,5 @@
|
||||||
|
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
|
@ -22,6 +17,11 @@ import mage.game.permanent.Permanent;
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Loki
|
* @author Loki
|
||||||
*/
|
*/
|
||||||
|
@ -72,8 +72,7 @@ class TunnelIgnusWatcher extends Watcher {
|
||||||
public void watch(GameEvent event, Game game) {
|
public void watch(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
|
if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
|
||||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||||
if (permanent.isLand() && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) {
|
if (permanent != null && permanent.isLand() && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) {
|
||||||
|
|
||||||
int count = counts.getOrDefault(permanent.getControllerId(), 0);
|
int count = counts.getOrDefault(permanent.getControllerId(), 0);
|
||||||
counts.put(permanent.getControllerId(), count + 1);
|
counts.put(permanent.getControllerId(), count + 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue