diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/AbstractCommander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/AbstractCommander.java index b8a3090f6f..4f80709c18 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/AbstractCommander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/AbstractCommander.java @@ -83,7 +83,7 @@ public abstract class AbstractCommander extends Constructed { return false; } if (commander1.getAbilities().containsClass(ChooseABackgroundAbility.class) == commander2.hasSubTypeForDeckbuilding(SubType.BACKGROUND) - || commander2.getAbilities().containsClass(ChooseABackgroundAbility.class) == commander1.hasSubTypeForDeckbuilding(SubType.BACKGROUND)) { + && commander2.getAbilities().containsClass(ChooseABackgroundAbility.class) == commander1.hasSubTypeForDeckbuilding(SubType.BACKGROUND)) { return true; } if (commander1.hasSubTypeForDeckbuilding(SubType.BACKGROUND)) { diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/deck/CommanderDeckValidationTest.java b/Mage.Tests/src/test/java/org/mage/test/serverside/deck/CommanderDeckValidationTest.java index 6301b9eefc..872c04f7fd 100644 --- a/Mage.Tests/src/test/java/org/mage/test/serverside/deck/CommanderDeckValidationTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/serverside/deck/CommanderDeckValidationTest.java @@ -71,4 +71,28 @@ public class CommanderDeckValidationTest extends MageTestBase { deckTester.validate(); } + + @Test(expected = AssertionError.class) + public void testBackgrounds() { + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Forest", 98); + + deckTester.addSideboard("Thrasios, Triton Hero", 1); + deckTester.addSideboard("Haunted One", 1); + + deckTester.validate( + "Commanders without the 'Choose a Background' ability should not be able to have a background as an additional commander"); + } + + @Test() + public void testBackgrounds2() { + DeckTester deckTester = new DeckTester(new Commander()); + deckTester.addMaindeck("Plains", 98); + + deckTester.addSideboard("Abdel Adrian, Gorion's Ward", 1); + deckTester.addSideboard("Haunted One", 1); + + deckTester.validate( + "Commanders with the 'Choose a Background' ability should be able to have a background as an additional commander"); + } }