mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 15:27:50 +07:00
Fixes incorrect default paramter for starting era (#5119)
This commit is contained in:
@ -25,7 +25,7 @@ class GameParameters { // Default values are the default new game
|
|||||||
|
|
||||||
// By default, all victory types except Diplomacy as it is quite new
|
// By default, all victory types except Diplomacy as it is quite new
|
||||||
var victoryTypes: ArrayList<VictoryType> = arrayListOf(VictoryType.Cultural, VictoryType.Domination, VictoryType.Scientific)
|
var victoryTypes: ArrayList<VictoryType> = arrayListOf(VictoryType.Cultural, VictoryType.Domination, VictoryType.Scientific)
|
||||||
var startingEra = "Ancient Era"
|
var startingEra = "Ancient era"
|
||||||
|
|
||||||
var isOnlineMultiplayer = false
|
var isOnlineMultiplayer = false
|
||||||
var baseRuleset: BaseRuleset = BaseRuleset.Civ_V_Vanilla
|
var baseRuleset: BaseRuleset = BaseRuleset.Civ_V_Vanilla
|
||||||
|
@ -294,8 +294,7 @@ class WorldScreenTopBar(val worldScreen: WorldScreen) : Table() {
|
|||||||
|
|
||||||
private fun getEquivalentTurn(gameInfo: GameInfo): Int {
|
private fun getEquivalentTurn(gameInfo: GameInfo): Int {
|
||||||
val totalTurns = 500f * gameInfo.gameParameters.gameSpeed.modifier
|
val totalTurns = 500f * gameInfo.gameParameters.gameSpeed.modifier
|
||||||
val startPercent = gameInfo.ruleSet.eras[gameInfo.gameParameters.startingEra]?.startPercent
|
val startPercent = gameInfo.ruleSet.eras[gameInfo.gameParameters.startingEra]!!.startPercent
|
||||||
if (startPercent == null) return gameInfo.turns
|
|
||||||
return gameInfo.turns + ((totalTurns * startPercent).toInt() / 100)
|
return gameInfo.turns + ((totalTurns * startPercent).toInt() / 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,6 @@ class SerializationTests {
|
|||||||
players.add(Player("Rome").apply { playerType = PlayerType.Human })
|
players.add(Player("Rome").apply { playerType = PlayerType.Human })
|
||||||
players.add(Player("Greece"))
|
players.add(Player("Greece"))
|
||||||
religionEnabled = true
|
religionEnabled = true
|
||||||
startingEra = "Ancient era"
|
|
||||||
}
|
}
|
||||||
val mapParameters = MapParameters().apply {
|
val mapParameters = MapParameters().apply {
|
||||||
mapSize = MapSizeNew(MapSize.Tiny)
|
mapSize = MapSizeNew(MapSize.Tiny)
|
||||||
|
Reference in New Issue
Block a user