diff --git a/src/battle.ts b/src/battle.ts index 317eaf2147..f7c46cbc57 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -2519,16 +2519,18 @@ export class Battle { this.log(args, kwArgs); break; } - case '-endTerastallize': { - let poke = this.getPokemon(args[1])!; - poke.removeVolatile('terastallize' as ID); - poke.teraType = ''; - poke.terastallized = ''; - poke.details = poke.details.replace(/, tera:[a-z]+/i, ''); - poke.searchid = poke.searchid.replace(/, tera:[a-z]+/i, ''); - this.scene.animTransform(poke, true); - this.scene.resetStatbar(poke); - this.log(args, kwArgs); + case '-custom': { + let poke = this.getPokemon(args[2])!; + if (args[1] && args[1] === 'endterastallize') { + poke.removeVolatile('terastallize' as ID); + poke.teraType = ''; + poke.terastallized = ''; + poke.details = poke.details.replace(/, tera:[a-z]+/i, ''); + poke.searchid = poke.searchid.replace(/, tera:[a-z]+/i, ''); + this.scene.animTransform(poke); + this.scene.resetStatbar(poke); + this.log(args, kwArgs); + } break; } case '-start': {