diff --git a/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt b/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt index c0b3dfd4c1..439ae28fa3 100644 --- a/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt +++ b/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt @@ -1,6 +1,7 @@ package com.unciv.models.ruleset.validation import com.badlogic.gdx.Gdx +import com.badlogic.gdx.files.FileHandle import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.graphics.g2d.TextureAtlas.TextureAtlasData import com.unciv.Constants @@ -755,6 +756,11 @@ class RulesetValidator(val ruleset: Ruleset) { } private fun checkTilesetSanity(lines: RulesetErrorList) { + // If running from a jar *and* checking a builtin ruleset, skip this check. + // - We can't list() the jsons, and the unit test before relase is sufficient, the tileset config can't have changed since then. + if (ruleset.folderLocation == null && this::class.java.`package`?.specificationVersion != null) + return + val tilesetConfigFolder = (ruleset.folderLocation ?: Gdx.files.internal("")).child("jsons\\TileSets") if (!tilesetConfigFolder.exists()) return diff --git a/core/src/com/unciv/ui/components/widgets/ZoomableScrollPane.kt b/core/src/com/unciv/ui/components/widgets/ZoomableScrollPane.kt index 9aaefe2ca9..cf78e3eea2 100644 --- a/core/src/com/unciv/ui/components/widgets/ZoomableScrollPane.kt +++ b/core/src/com/unciv/ui/components/widgets/ZoomableScrollPane.kt @@ -19,8 +19,6 @@ import com.unciv.UncivGame import com.unciv.models.metadata.GameSettings import com.unciv.ui.components.ZoomGestureListener import com.unciv.ui.components.input.KeyboardPanningListener -import java.lang.Float.max -import java.lang.Float.min import kotlin.math.sqrt @@ -138,7 +136,7 @@ open class ZoomableScrollPane( } open fun zoom(zoomScale: Float) { - val newZoom = min(max(zoomScale, minZoom), maxZoom) + val newZoom = zoomScale.coerceIn(minZoom, maxZoom) val oldZoomX = scaleX val oldZoomY = scaleY