mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-20 16:42:45 +02:00
[Bug] Fix old session load modifier crash (#5814)
Fix inability to load saves due to modifier type being nulled
This commit is contained in:
parent
d790b30a30
commit
9b1a222935
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user