mirror of
https://github.com/correl/mage.git
synced 2025-03-16 09:16:26 -09:00
* Fixed possible NPE (fixes #358). Added game log info about sacrificed permanents.
This commit is contained in:
parent
b005e7b03f
commit
60336cbc4b
1 changed files with 5 additions and 1 deletions
|
@ -805,6 +805,10 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
|
||||||
//20091005 - 701.13
|
//20091005 - 701.13
|
||||||
if (!game.replaceEvent(GameEvent.getEvent(EventType.SACRIFICE_PERMANENT, objectId, sourceId, controllerId))) {
|
if (!game.replaceEvent(GameEvent.getEvent(EventType.SACRIFICE_PERMANENT, objectId, sourceId, controllerId))) {
|
||||||
if (moveToZone(Zone.GRAVEYARD, sourceId, game, true)) {
|
if (moveToZone(Zone.GRAVEYARD, sourceId, game, true)) {
|
||||||
|
Player player = game.getPlayer(getControllerId());
|
||||||
|
if (player != null) {
|
||||||
|
game.informPlayers(new StringBuilder(player.getName()).append(" sacrificed ").append(this.getName()).toString());
|
||||||
|
}
|
||||||
game.fireEvent(GameEvent.getEvent(EventType.SACRIFICED_PERMANENT, objectId, sourceId, controllerId));
|
game.fireEvent(GameEvent.getEvent(EventType.SACRIFICED_PERMANENT, objectId, sourceId, controllerId));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -870,7 +874,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
|
||||||
}
|
}
|
||||||
Permanent attacker = game.getPermanent(attackerId);
|
Permanent attacker = game.getPermanent(attackerId);
|
||||||
// controller of attacking permanent must be an opponent
|
// controller of attacking permanent must be an opponent
|
||||||
if (!game.getOpponents(this.getControllerId()).contains(attacker.getControllerId())) {
|
if (game.getOpponents(this.getControllerId()) != null && !game.getOpponents(this.getControllerId()).contains(attacker.getControllerId())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//20101001 - 509.1b
|
//20101001 - 509.1b
|
||||||
|
|
Loading…
Add table
Reference in a new issue