Fix Mogis God of Slaughter's ability when a player has no creatures.

Fixes https://github.com/magefree/mage/issues/6232
This commit is contained in:
dilnu 2020-02-01 19:13:47 -05:00
parent b708494647
commit 6f513c4630

View file

@ -77,9 +77,12 @@ class MogisGodOfSlaughterEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(game.getActivePlayerId());
if (player == null || game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, game.getActivePlayerId(), game) == 0) {
if (player == null) {
return false;
}
if (game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, game.getActivePlayerId(), game) == 0) {
return player.damage(2, source.getSourceId(), game) > 0;
}
TargetPermanent target = new TargetControlledCreaturePermanent(1);
target.setNotTarget(true);
if (target.canChoose(player.getId(), game)