smogon / pokemon-showdown

Pokémon battle simulator.
https://pokemonshowdown.com
MIT License
4.77k stars 2.79k forks source link

[Gen 4] Custap Berry + Trump Card interaction causes a crash #5393

Closed scheibo closed 5 years ago

scheibo commented 5 years ago
 TypeError: Cannot read property 'pp' of null
    at Battle.basePowerCallback (/Pokemon-Showdown/data/moves.js:18263:21)
    at Battle.getDamage (/Pokemon-Showdown/.sim-dist/battle.js:1953:39)
    at Battle.getSpreadDamage (/Pokemon-Showdown/data/scripts.js:806:25)
    at Battle.spreadMoveHit (/Pokemon-Showdown/data/scripts.js:755:17)
    at Battle.hitStepMoveHitLoop (/Pokemon-Showdown/data/scripts.js:653:37)
    at Battle.trySpreadMoveHit (/Pokemon-Showdown/data/scripts.js:338:26)
    at Battle.useMoveInner (/Pokemon-Showdown/data/scripts.js:248:22)
    at Battle.useMove (/Pokemon-Showdown/data/scripts.js:138:25)
    at Battle.runMove (/Pokemon-Showdown/data/scripts.js:93:31)
    at Battle.runAction (/Pokemon-Showdown/.sim-dist/battle.js:2552:9)

See input log to repro.

Yay! My smoke test works!

Slayer95 commented 5 years ago

Looks like Custap Berry should be removed from the possible sourceEffect values of moves, just like Instruct is in useMoveInner()