From 30e0f8b85a31151a992888261c81fc30c13bfadc Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Tue, 25 Aug 2015 15:21:45 +0200 Subject: [PATCH] * Commander - Fixed that a player lost by commander damage was posted continuously to the game log while the multiplayer game was ongoing. --- Mage/src/mage/game/GameCommanderImpl.java | 2 +- Mage/src/mage/watchers/common/CommanderInfoWatcher.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Mage/src/mage/game/GameCommanderImpl.java b/Mage/src/mage/game/GameCommanderImpl.java index f6a47aad00..4181efc3e4 100644 --- a/Mage/src/mage/game/GameCommanderImpl.java +++ b/Mage/src/mage/game/GameCommanderImpl.java @@ -193,7 +193,7 @@ public abstract class GameCommanderImpl extends GameImpl { for (Map.Entry entrySet : damageWatcher.getDamageToPlayer().entrySet()) { if (entrySet.getValue() > 20) { Player opponent = getPlayer(entrySet.getKey()); - if (opponent != null && player.isInGame()) { + if (opponent != null && !opponent.hasLost() && player.isInGame()) { opponent.lost(this); } } diff --git a/Mage/src/mage/watchers/common/CommanderInfoWatcher.java b/Mage/src/mage/watchers/common/CommanderInfoWatcher.java index 963fcaf374..6a81f5505e 100644 --- a/Mage/src/mage/watchers/common/CommanderInfoWatcher.java +++ b/Mage/src/mage/watchers/common/CommanderInfoWatcher.java @@ -113,13 +113,12 @@ public class CommanderInfoWatcher extends Watcher { sb.append(" ").append(castCount).append(castCount == 1 ? " time" : " times").append(" casted from the command zone."); } this.addInfo(object, "Commander", sb.toString(), game); - if (checkCommanderDamage) { for (Map.Entry entry : damageToPlayer.entrySet()) { Player damagedPlayer = game.getPlayer(entry.getKey()); - sb.setLength(0); sb.append("Commander did ").append(entry.getValue()).append(" combat damage to player ").append(damagedPlayer.getLogName()).append("."); - this.addInfo(object, new StringBuilder("Commander").append(entry.getKey()).toString(), sb.toString(), game); + this.addInfo(object, "Commander" + entry.getKey(), + "Commander did " + entry.getValue() + " combat damage to player " + damagedPlayer.getLogName() + ".", game); } } }