-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add migration for scene weather configuration
- Loading branch information
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { migrate } from "../helpers"; | ||
|
||
export async function migrate4() { | ||
return migrate(migrationConfiguration4); | ||
} | ||
|
||
/** @type {import('../helpers').MigrationConfiguration} */ | ||
export const migrationConfiguration4 = { | ||
Scene: migrateScene, | ||
}; | ||
|
||
async function migrateScene(scene) { | ||
const originalWeatherEffectKeys = Object.keys(CONFIG.originalWeatherEffects); | ||
const weatherEffectsToMigrate = Object.keys(CONFIG.fxmaster.particleEffects).filter( | ||
(effect) => !originalWeatherEffectKeys.includes(effect), // only migrate effects where we are certain they are ours | ||
); | ||
|
||
if (weatherEffectsToMigrate.includes(scene.weather)) { | ||
await scene.update({ weather: `fxmaster.${scene.weather}` }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters