diff --git a/core/src/com/unciv/UncivGame.kt b/core/src/com/unciv/UncivGame.kt index 5d0f89312f..84816c1056 100644 --- a/core/src/com/unciv/UncivGame.kt +++ b/core/src/com/unciv/UncivGame.kt @@ -41,6 +41,12 @@ class UncivGame( /** For when you need to test something in an advanced game and don't have time to faff around */ val superchargedForDebug = false + /** Simulate until this turn on the first "Next turn" button press. + * Does not update World View changes until finished. + * Set to 0 to disable. + */ + val simulateUntilTurnForDebug: Int = 0 + var rewriteTranslationFiles = false lateinit var worldScreen: WorldScreen diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index 5be80e0b07..8ac1c5cf33 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -80,7 +80,9 @@ class GameInfo { switchTurn() - while(thisPlayer.playerType==PlayerType.AI){ + while (thisPlayer.playerType == PlayerType.AI + || UncivGame.Current.simulateUntilTurnForDebug > turns + ) { if(thisPlayer.isBarbarian() || !thisPlayer.isDefeated()) { NextTurnAutomation().automateCivMoves(thisPlayer) diff --git a/tests/src/com/unciv/testing/BasicTests.kt b/tests/src/com/unciv/testing/BasicTests.kt index 1c54ab79c2..fdd0f8a36d 100644 --- a/tests/src/com/unciv/testing/BasicTests.kt +++ b/tests/src/com/unciv/testing/BasicTests.kt @@ -39,7 +39,8 @@ class BasicTests { Assert.assertTrue("This test will only pass if the game is not run with debug modes", !game.superchargedForDebug && !game.viewEntireMapForDebug - && !game.rewriteTranslationFiles) + && !game.rewriteTranslationFiles + && game.simulateUntilTurnForDebug <= 0) } // If there's a unit that obsoletes with no upgrade then when it obsoletes