Skip to content

Commit

Permalink
Update Pokemon.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Voinea-Radu authored Sep 29, 2023
1 parent c0e5e77 commit ca5a439
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,15 @@ open class Pokemon : ShowdownIdentifiable {
if (json.has(DataKeys.TETHERING_ID)) {
tetheringId = UUID.fromString(json.get(DataKeys.TETHERING_ID).asString)
}
this.teraType = ElementalTypes.get(json.get(DataKeys.POKEMON_TERA_TYPE).asString) ?: this.primaryType

val jsonObjectTeraType = json.get(DataKeys.POKEMON_TERA_TYPE)

if (jsonObjectTeraType == null) {
this.teraType = this.primaryType;
} else {
this.teraType = ElementalTypes.get(json.get(DataKeys.POKEMON_TERA_TYPE).asString) ?: this.primaryType
}

this.dmaxLevel = json.get(DataKeys.POKEMON_DMAX_LEVEL).asInt
this.gmaxFactor = json.get(DataKeys.POKEMON_GMAX_FACTOR).asBoolean
return this
Expand Down

0 comments on commit ca5a439

Please sign in to comment.