Fix inability to load saves due to modifier type being nulled

This commit is contained in:
Sirz Benjie 2025-05-11 23:06:35 -05:00
parent d790b30a30
commit 60f7aaaa93
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E

View File

@ -2921,7 +2921,10 @@ export default class BattleScene extends SceneBase {
instant?: boolean, instant?: boolean,
cost?: number, cost?: number,
): boolean { ): boolean {
if (!modifier) { // We check against modifier.type to stop a bug related to loading in a pokemon that has a form change item, which prior to some patch
// that changed form change modifiers worked, had previously set the `type` field to null.
// TODO: This is not the right place to check for this; it should ideally go in a session migrator.
if (!modifier || !modifier.type) {
return false; return false;
} }
let success = false; let success = false;