fixed issue 107

This commit is contained in:
BetaSteward 2011-06-17 14:51:03 -04:00
parent 09be5934f5
commit c92c506878

View file

@ -200,7 +200,9 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
Permanent attacker = game.getPermanent(attackers.get(0));
Player player = game.getPlayer(attacker.getControllerId());
int damage = attacker.getPower().getValue();
if (attacker != null && canDamage(attacker, first)) {
if (attacker == null)
return;
if (canDamage(attacker, first)) {
Map<UUID, Integer> assigned = new HashMap<UUID, Integer>();
for (UUID blockerId: blockerOrder) {
Permanent blocker = game.getPermanent(blockerId);
@ -237,6 +239,14 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
blocker.damage(entry.getValue(), attacker.getId(), game, true, true);
}
}
else {
for (UUID blockerId: blockerOrder) {
Permanent blocker = game.getPermanent(blockerId);
if (canDamage(blocker, first)) {
attacker.damage(blocker.getPower().getValue(), blocker.getId(), game, true, true);
}
}
}
}
private void defenderDamage(Permanent attacker, int amount, Game game) {