Merge branch 'sim-draw-npe' into 'master'

fix sw.stop bug, added draw condition for timeouts and both players life 0

See merge request core-developers/forge!3251
This commit is contained in:
Michael Kamensky
2020-10-08 14:16:20 +00:00

View File

@@ -203,10 +203,8 @@ public class SimulateMatch {
}
// If both players life totals to 0 in a single turn, the game should end in a draw
if(g1.getOutcome().getLifeDelta() == 0){
g1.setGameOver(GameEndReason.Draw);
if(g1.getOutcome().isDraw()){
System.out.println(String.format("Game %d ended in a Draw! Took %d ms.", 1+iGame, sw.getTime()));
sw.stop();
} else {
System.out.println(String.format("\nGame %d ended in %d ms. %s has won!\n", 1+iGame, sw.getTime(), g1.getOutcome().getWinningLobbyPlayer().getName()));
}