Merge branch 'feature/minor-fixes' into 'main'

fix evs not updating client side

Closes #1152

See merge request cable-mc/cobblemon!1267
This commit is contained in:
Hiroku
2024-11-10 01:26:10 +00:00
3 changed files with 30 additions and 6 deletions
@@ -942,8 +942,16 @@ open class Pokemon : ShowdownIdentifiable {
this.experience = other.experience
this.setFriendship(other.friendship)
// Applied before current health for calcs to take place
this.ivs = other.ivs
this.evs = other.evs
other.ivs.doWithoutEmitting {
this.ivs.forEach {
other.ivs[it.key] = it.value
}
}
other.evs.doWithoutEmitting {
this.evs.forEach {
other.evs[it.key] = it.value
}
}
this.currentHealth = other.currentHealth
this.gender = other.gender
this.moveSet.copyFrom(other.moveSet)
@@ -59,8 +59,16 @@ internal class ClientPokemonP1(
other.experience = this.experience
other.setFriendship(this.friendship)
// Applied before current health for calcs to take place
other.ivs = this.ivs
other.evs = this.evs
other.ivs.doWithoutEmitting {
this.ivs.forEach {
other.ivs[it.key] = it.value
}
}
other.evs.doWithoutEmitting {
this.evs.forEach {
other.evs[it.key] = it.value
}
}
other.currentHealth = this.currentHealth
other.gender = this.gender
other.moveSet.copyFrom(this.moveSet)
@@ -53,8 +53,16 @@ internal class PokemonP1(
other.experience = this.experience
other.setFriendship(this.friendship)
// Applied before current health for calcs to take place
other.ivs = this.ivs
other.evs = this.evs
other.ivs.doWithoutEmitting {
this.ivs.forEach {
other.ivs[it.key] = it.value
}
}
other.evs.doWithoutEmitting {
this.evs.forEach {
other.evs[it.key] = it.value
}
}
other.currentHealth = this.currentHealth
other.gender = this.gender
other.moveSet.copyFrom(this.moveSet)