Hotfix uturn with kings rock (#2385)

This commit is contained in:
Tempoanon 2024-06-18 15:26:51 -04:00 committed by GitHub
parent 21f1e077fa
commit 04c94fcbba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -525,6 +525,10 @@ export abstract class PokemonHeldItemModifier extends PersistentModifier {
//Applies to items with chance of activating secondary effects ie Kings Rock
getSecondaryChanceMultiplier(pokemon: Pokemon): integer {
// Temporary quickfix to stop game from freezing when the opponet uses u-turn while holding on to king's rock
if (!pokemon.getLastXMoves(0)[0]) {
return 1;
}
const sheerForceAffected = allMoves[pokemon.getLastXMoves(0)[0].move].chance >= 0 && pokemon.hasAbility(Abilities.SHEER_FORCE);
if (sheerForceAffected) {