fix Fanatic of the Harrowing

This commit is contained in:
xenohedron 2025-02-24 22:21:46 -05:00
parent 411100e442
commit c2797ee24c

View file

@ -61,17 +61,21 @@ class FanaticOfTheHarrowingEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
boolean flag = false; boolean flag = false;
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(playerId);
if (player == null) { if (player == null) {
continue; continue;
} }
if (!player.discard(1, false, false, source, game).isEmpty() if (!player.discard(1, false, false, source, game).isEmpty()
&& player.equals(source.getControllerId())) { && playerId.equals(source.getControllerId())) {
flag = true; flag = true;
} }
} }
game.processAction();
if (flag) { if (flag) {
game.getPlayer(source.getControllerId()).drawCards(1, source, game); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.drawCards(1, source, game);
}
} }
return true; return true;
} }