Skip to content

Commit

Permalink
Use isNullOrUndefined, Clean Up Imports
Browse files Browse the repository at this point in the history
  • Loading branch information
xsn34kzx committed Nov 16, 2024
1 parent 7fac510 commit 5b70b04
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/system/version_migration/versions/v1_0_4.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { SettingKeys } from "../../settings/settings";
import { AbilityAttr, defaultStarterSpecies, DexAttr, SystemSaveData, SessionSaveData } from "../../game-data";
import { allSpecies } from "../../../data/pokemon-species";
import { SettingKeys } from "#app/system/settings/settings";
import { AbilityAttr, defaultStarterSpecies, DexAttr, SystemSaveData, SessionSaveData } from "#app/system/game-data";
import { allSpecies } from "#app/data/pokemon-species";
import { isNullOrUndefined } from "#app/utils";

export const systemMigrators = [
/**
Expand Down Expand Up @@ -46,7 +47,7 @@ export const systemMigrators = [
* @param data {@linkcode SystemSaveData}
*/
function fixStarterData(data: SystemSaveData) {
if (data.starterData !== null) {
if (!isNullOrUndefined(data.starterData)) {
for (const starterId of defaultStarterSpecies) {
if (data.starterData[starterId]?.abilityAttr) {
data.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1;
Expand Down

0 comments on commit 5b70b04

Please sign in to comment.