recipes: allow 0 as valid id

This commit is contained in:
Bixilon 2023-06-24 13:19:34 +02:00
parent 5e5463f6bb
commit 25eeb77a05
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -54,7 +54,7 @@ class RecipeRegistry(
override fun getId(value: Recipe): Int { override fun getId(value: Recipe): Int {
val id = valueIdMap.getInt(value) val id = valueIdMap.getInt(value)
if (id > 0) return id if (id >= 0) return id
return parent?.getId(value) ?: throw IllegalArgumentException("No id available for $value") return parent?.getId(value) ?: throw IllegalArgumentException("No id available for $value")
} }