diff --git a/core/src/chrislo27/rhre/Main.kt b/core/src/chrislo27/rhre/Main.kt index 4291fd144..92c21e36e 100644 --- a/core/src/chrislo27/rhre/Main.kt +++ b/core/src/chrislo27/rhre/Main.kt @@ -156,14 +156,8 @@ class Main(l: Logger) : ionium.templates.Main(l) { preferences = Gdx.app.getPreferences("RHRE2") - fun Int.ensureAtLeastWhenZero(min: Int): Int { - if (this <= 0) - return min - return this - } - - oldSize = Triple(preferences.getInteger("width", 1280).ensureAtLeastWhenZero(1280), - preferences.getInteger("height", 720).ensureAtLeastWhenZero(720), + oldSize = Triple(preferences.getInteger("width", 1280).takeUnless { it <= 0 } ?: 1280, + preferences.getInteger("height", 720).takeUnless { it <= 0 } ?: 720, preferences.getBoolean("fullscreen", false)) fun addBundle(namedLocale: NamedLocale, onlyLoadGlyphs: Boolean = false) {