Won't send to log empty entries

This commit is contained in:
Maxmtg
2013-05-28 15:27:59 +00:00
parent a211222b3e
commit 226f2e90a9

View File

@@ -23,6 +23,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import forge.Card;
import forge.GameEventType;
import forge.card.ability.AbilityFactory;
@@ -149,8 +151,10 @@ public class ReplacementHandler {
chosenRE.setHasRun(true);
ReplacementResult res = this.executeReplacement(runParams, chosenRE, decider, game);
if (res != ReplacementResult.NotReplaced) {
chosenRE.setHasRun(false);
game.getGameLog().add(GameEventType.EFFECT_REPLACED, chosenRE.toString());
chosenRE.setHasRun(false);
String message = chosenRE.toString();
if ( !StringUtils.isEmpty(message))
game.getGameLog().add(GameEventType.EFFECT_REPLACED, chosenRE.toString());
return res;
} else {
if (possibleReplacers.size() == 0) {