mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Fix another problem with Thespian's Stage copying itself and add a test.
This commit is contained in:
@@ -102,6 +102,10 @@ public class CardState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public final void setType(final CardType type0) {
|
public final void setType(final CardType type0) {
|
||||||
|
if (type0 == type) {
|
||||||
|
// Logic below would incorrectly clear the type if it's the same object.
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (type0.isEmpty() && type.isEmpty()) { return; }
|
if (type0.isEmpty() && type.isEmpty()) { return; }
|
||||||
type.clear();
|
type.clear();
|
||||||
type.addAll(type0);
|
type.addAll(type0);
|
||||||
|
|||||||
@@ -568,6 +568,7 @@ public class GameSimulatorTest extends TestCase {
|
|||||||
addCard("Swamp", p);
|
addCard("Swamp", p);
|
||||||
addCard("Swamp", p);
|
addCard("Swamp", p);
|
||||||
Card thespian = addCard("Thespian's Stage", p);
|
Card thespian = addCard("Thespian's Stage", p);
|
||||||
|
assertTrue(thespian.isLand());
|
||||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
||||||
game.getAction().checkStateEffects(true);
|
game.getAction().checkStateEffects(true);
|
||||||
|
|
||||||
@@ -578,6 +579,8 @@ public class GameSimulatorTest extends TestCase {
|
|||||||
GameSimulator sim = createSimulator(game, p);
|
GameSimulator sim = createSimulator(game, p);
|
||||||
sim.simulateSpellAbility(sa);
|
sim.simulateSpellAbility(sa);
|
||||||
Game simGame = sim.getSimulatedGameState();
|
Game simGame = sim.getSimulatedGameState();
|
||||||
assertNotNull(gameStateToString(simGame), findCardWithName(simGame, "Thespian's Stage"));
|
Card thespianSim = findCardWithName(simGame, "Thespian's Stage");
|
||||||
|
assertNotNull(gameStateToString(simGame), thespianSim);
|
||||||
|
assertTrue(thespianSim.isLand());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user