mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 00:36:25 +00:00
[Hotfix] Fix System Data Conversion Failure 2 (#4159)
This commit is contained in:
parent
bd4729b4c5
commit
4808c07cf9
@ -76,7 +76,7 @@ export function applySystemDataPatches(data: SystemSaveData) {
|
|||||||
if (data.starterData) {
|
if (data.starterData) {
|
||||||
// Migrate ability starter data if empty for caught species
|
// Migrate ability starter data if empty for caught species
|
||||||
Object.keys(data.starterData).forEach(sd => {
|
Object.keys(data.starterData).forEach(sd => {
|
||||||
if (data.dexData[sd].caughtAttr && !data.starterData[sd].abilityAttr) {
|
if (data.dexData[sd]?.caughtAttr && (data.starterData[sd] && !data.starterData[sd].abilityAttr)) {
|
||||||
data.starterData[sd].abilityAttr = 1;
|
data.starterData[sd].abilityAttr = 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -104,9 +104,11 @@ export function applySystemDataPatches(data: SystemSaveData) {
|
|||||||
// --- PATCHES ---
|
// --- PATCHES ---
|
||||||
|
|
||||||
// Fix Starter Data
|
// Fix Starter Data
|
||||||
if (data.starterData) {
|
|
||||||
for (const starterId of defaultStarterSpecies) {
|
for (const starterId of defaultStarterSpecies) {
|
||||||
|
if (data.starterData[starterId]?.abilityAttr) {
|
||||||
data.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1;
|
data.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1;
|
||||||
|
}
|
||||||
|
if (data.dexData[starterId]?.caughtAttr) {
|
||||||
data.dexData[starterId].caughtAttr |= DexAttr.FEMALE;
|
data.dexData[starterId].caughtAttr |= DexAttr.FEMALE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user