Open Brsk79 opened 4 months ago
Link to discord's (fusing a pokemon with a fainted pokemon shows the fainted icon, even though it's alive) https://discord.com/channels/1125469663833370665/1274134775895949407
From PR #4007
@seanrmon wrote
Unrelated but there's another bug in the fuse() function:
if (!this.isFainted()) { // If this Pokemon hasn't fainted, make sure the HP wasn't set over the new maximum this.hp = Math.min(this.hp, maxHp); this.status = getRandomStatus(this.status, pokemon.status); // Get a random valid status between the two } else if (!pokemon.isFainted()) { // If this Pokemon fainted but the other hasn't, make sure the HP wasn't set to zero this.hp = Math.max(this.hp, 1); this.status = pokemon.status; // Inherit the other Pokemon's status }
should be
if ((!this.isFainted())&&(!pokemon.isFainted())) { // If this Pokemon hasn't fainted, make sure the HP wasn't set over the new maximum this.hp = Math.min(this.hp, maxHp); this.status = getRandomStatus(this.status, pokemon.status); // Get a random valid status between the two } else if (!pokemon.isFainted()) { // If this Pokemon fainted but the other hasn't, make sure the HP wasn't set to zero this.hp = Math.max(this.hp, 1); this.status = pokemon.status; // Inherit the other Pokemon's status }
I've seen this happen in-game where a resulting fusion pokemon has the "Fainted" status, even though it's at max HP. You don't need to do anything in the "else" case because only secondary pokemon is fainted, so we don't need to do anything
The fused pkmn can still be used in battle.
Step to reproduce: fuse together pkmn A (healthy) and B (fainted), in my case the second one was fainted but idk it that has nothing to do with the bug.