mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Fixed possible null pointer exception of Bitter Feud.
This commit is contained in:
parent
88d6d0fa0f
commit
e772c768cd
1 changed files with 17 additions and 16 deletions
|
@ -60,7 +60,6 @@ public class BitterFeud extends CardImpl {
|
|||
super(ownerId, 32, "Bitter Feud", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{R}");
|
||||
this.expansionSetCode = "C14";
|
||||
|
||||
|
||||
// As Bitter Feud enters the battlefield, choose two players.
|
||||
this.addAbility(new AsEntersBattlefieldAbility(new BitterFeudEntersBattlefieldEffect()));
|
||||
|
||||
|
@ -97,6 +96,7 @@ class BitterFeudEntersBattlefieldEffect extends OneShotEffect {
|
|||
TargetPlayer target = new TargetPlayer(2, 2, true);
|
||||
controller.chooseTarget(outcome, target, source, game);
|
||||
Player player1 = game.getPlayer(target.getFirstTarget());
|
||||
if (target.getTargets().size() > 1) {
|
||||
Player player2 = game.getPlayer(target.getTargets().get(1));
|
||||
if (player1 != null && player2 != null) {
|
||||
game.getState().setValue(source.getSourceId() + "_player1", player1);
|
||||
|
@ -106,6 +106,7 @@ class BitterFeudEntersBattlefieldEffect extends OneShotEffect {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -178,9 +179,9 @@ class BitterFeudEffect extends ReplacementEffectImpl {
|
|||
} else if (damageSource instanceof Card) {
|
||||
sourcePlayerId = ((Card) damageSource).getOwnerId();
|
||||
}
|
||||
if (sourcePlayerId != null &&
|
||||
(player1.getId().equals(sourcePlayerId) || player2.getId().equals(sourcePlayerId)) &&
|
||||
!sourcePlayerId.equals(targetPlayerId)) {
|
||||
if (sourcePlayerId != null
|
||||
&& (player1.getId().equals(sourcePlayerId) || player2.getId().equals(sourcePlayerId))
|
||||
&& !sourcePlayerId.equals(targetPlayerId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue