mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Cleanup and NPE protection.
This commit is contained in:
@@ -110,13 +110,15 @@ public class GameCopier {
|
||||
}
|
||||
}
|
||||
}
|
||||
newSa.setActivatingPlayer(map.map(origSa.getActivatingPlayer()));
|
||||
if (origSa.usesTargeting()) {
|
||||
for (GameObject o : origSa.getTargets().getTargets()) {
|
||||
newSa.getTargets().add(map.map(o));
|
||||
}
|
||||
if (newSa != null) {
|
||||
newSa.setActivatingPlayer(map.map(origSa.getActivatingPlayer()));
|
||||
if (origSa.usesTargeting()) {
|
||||
for (GameObject o : origSa.getTargets().getTargets()) {
|
||||
newSa.getTargets().add(map.map(o));
|
||||
}
|
||||
}
|
||||
newGame.getStack().add(newSa);
|
||||
}
|
||||
newGame.getStack().add(newSa);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -162,13 +162,8 @@ public class GameSimulator {
|
||||
return Integer.MIN_VALUE;
|
||||
}
|
||||
// TODO: Support multiple opponents.
|
||||
Player opponent = null;
|
||||
for (Player p : simGame.getPlayers()) {
|
||||
if (p != aiPlayer) {
|
||||
opponent = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Player opponent = aiPlayer.getOpponent();
|
||||
|
||||
resolveStack(simGame, opponent);
|
||||
|
||||
// TODO: If this is during combat, before blockers are declared,
|
||||
|
||||
Reference in New Issue
Block a user