mirror of
https://github.com/correl/mage.git
synced 2024-12-25 19:25:41 +00:00
[ZNR] fixed an error with Nimble Trapfinder rules text (#7046)
This commit is contained in:
parent
dcc6ce9752
commit
3af2d11992
1 changed files with 6 additions and 2 deletions
|
@ -85,7 +85,7 @@ enum NimbleTrapfinderCondition implements Condition {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
NimbleTrapfinderWatcher watcher = game.getState().getWatcher(NimbleTrapfinderWatcher.class);
|
||||
return watcher != null && watcher.checkPlayer(game.getPermanent(source.getSourceId()), game);
|
||||
return watcher != null && watcher.checkPlayer(source.getSourceId(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -133,7 +133,11 @@ class NimbleTrapfinderWatcher extends Watcher {
|
|||
playerMap.clear();
|
||||
}
|
||||
|
||||
boolean checkPlayer(Permanent permanent, Game game) {
|
||||
boolean checkPlayer(UUID sourceId, Game game) {
|
||||
Permanent permanent = game.getPermanent(sourceId);
|
||||
if (permanent == null) {
|
||||
return !playerMap.computeIfAbsent(game.getOwnerId(sourceId), u -> new HashSet<>()).isEmpty();
|
||||
}
|
||||
return playerMap
|
||||
.computeIfAbsent(permanent.getControllerId(), u -> new HashSet<>())
|
||||
.stream()
|
||||
|
|
Loading…
Reference in a new issue