adjust CardsLeftGraveyardWatcher

related to #10550
This commit is contained in:
xenohedron 2024-01-26 20:12:07 -05:00
parent f35e00463d
commit 473d899bf6
2 changed files with 35 additions and 2 deletions

View file

@ -29,8 +29,12 @@ public class CardsLeftGraveyardWatcher extends Watcher {
|| ((ZoneChangeEvent) event).getFromZone() != Zone.GRAVEYARD) {
return;
}
UUID playerId = event.getPlayerId();
if (playerId == null || game.getCard(event.getTargetId()) == null) {
Card card = game.getCard(event.getTargetId());
if (card == null) {
return;
}
UUID playerId = card.getOwnerId();
if (playerId == null) {
return;
}
cardsLeftGraveyardThisTurn.computeIfAbsent(playerId, k -> new HashSet<>())