diff --git a/core/src/com/unciv/models/metadata/GameParameters.kt b/core/src/com/unciv/models/metadata/GameParameters.kt index 69e1217e3b..f41f3268cf 100644 --- a/core/src/com/unciv/models/metadata/GameParameters.kt +++ b/core/src/com/unciv/models/metadata/GameParameters.kt @@ -21,4 +21,19 @@ class GameParameters { // Default values are the default new game var isOnlineMultiplayer = false var mods = HashSet() + + fun clone(): GameParameters { + val parameters=GameParameters() + parameters.difficulty=difficulty + parameters.gameSpeed=gameSpeed + parameters.players= ArrayList(players) + parameters.numberOfCityStates=numberOfCityStates + parameters.noBarbarians=noBarbarians + parameters.oneCityChallenge=oneCityChallenge + parameters.victoryTypes= ArrayList(victoryTypes) + parameters.startingEra=startingEra + parameters.isOnlineMultiplayer=isOnlineMultiplayer + parameters.mods= HashSet(mods) + return parameters + } } \ No newline at end of file diff --git a/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt b/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt index 21d91ef336..a463367774 100644 --- a/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt +++ b/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt @@ -13,17 +13,17 @@ import com.unciv.logic.civilization.PlayerType import com.unciv.models.ruleset.RulesetCache import com.unciv.models.translations.tr import com.unciv.ui.pickerscreens.PickerScreen +import com.unciv.ui.utils.Popup import com.unciv.ui.utils.disable import com.unciv.ui.utils.enable import com.unciv.ui.utils.onClick import com.unciv.ui.worldscreen.mainmenu.OnlineMultiplayer -import com.unciv.ui.utils.Popup import java.util.* import kotlin.concurrent.thread class NewGameScreen: PickerScreen(){ - val newGameParameters= UncivGame.Current.gameInfo.gameParameters + val newGameParameters= UncivGame.Current.gameInfo.gameParameters.clone() val mapParameters = UncivGame.Current.gameInfo.tileMap.mapParameters val ruleset = RulesetCache.getComplexRuleset(newGameParameters.mods)