Fixed bug with hasData not being cleared and improved sapling tree selection.

- Choose the latest tree above the requested height
This commit is contained in:
Kevin Gorham 2019-12-23 14:47:58 -05:00
parent 596bea0158
commit 7babe0c63c
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
2 changed files with 5 additions and 3 deletions

View File

@ -183,6 +183,7 @@ class Initializer(
*/
fun clear() {
rustBackend.clear()
prefs[PREFS_HAS_DATA] = false
}
/**
@ -294,9 +295,10 @@ class Initializer(
)
val file: String
try {
file = treeFiles.first() {
if (birthdayHeight == null) true
else it.contains(birthdayHeight.toString())
file = if (birthdayHeight == null) treeFiles.first() else {
treeFiles.first {
it.split(".").first().toInt() <= birthdayHeight
}
}
} catch (t: Throwable) {
throw BirthdayException.BirthdayFileNotFoundException(