mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
fix null-check in raging river and a watcher
This commit is contained in:
parent
ed3742b1e4
commit
7f319c2751
2 changed files with 8 additions and 5 deletions
|
@ -152,9 +152,11 @@ class RagingRiverEffect extends OneShotEffect {
|
||||||
filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
|
filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
|
||||||
} else {
|
} else {
|
||||||
List<Permanent> leftLog = left.stream()
|
List<Permanent> leftLog = left.stream()
|
||||||
|
.filter(permanent -> permanent.getControllerId() != null)
|
||||||
.filter(permanent -> permanent.getControllerId().equals(defender.getId()))
|
.filter(permanent -> permanent.getControllerId().equals(defender.getId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<Permanent> rightLog = right.stream()
|
List<Permanent> rightLog = right.stream()
|
||||||
|
.filter(permanent -> permanent.getControllerId() != null)
|
||||||
.filter(permanent -> permanent.getControllerId().equals(defender.getId()))
|
.filter(permanent -> permanent.getControllerId().equals(defender.getId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
|
@ -5,16 +5,17 @@
|
||||||
*/
|
*/
|
||||||
package mage.watchers.common;
|
package mage.watchers.common;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.constants.WatcherScope;
|
import mage.constants.WatcherScope;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.watchers.Watcher;
|
import mage.watchers.Watcher;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author LevelX2 (spjspj)
|
* @author LevelX2 (spjspj)
|
||||||
|
@ -75,7 +76,7 @@ public class PermanentsEnteredBattlefieldYourLastTurnWatcher extends Watcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Permanent> getPermanentsEnteringOnPlayersLastTurn(Game game, UUID playerId) {
|
public List<Permanent> getPermanentsEnteringOnPlayersLastTurn(Game game, UUID playerId) {
|
||||||
if (game.getActivePlayerId() == playerId) {
|
if (game.getActivePlayerId().equals(playerId)) {
|
||||||
return enteringBattlefield.get(playerId);
|
return enteringBattlefield.get(playerId);
|
||||||
}
|
}
|
||||||
return enteringBattlefieldLastTurn.get(playerId);
|
return enteringBattlefieldLastTurn.get(playerId);
|
||||||
|
|
Loading…
Reference in a new issue