diff --git a/src/sceneDefaults.js b/src/sceneDefaults.js index 78fb518..52e6040 100644 --- a/src/sceneDefaults.js +++ b/src/sceneDefaults.js @@ -15,32 +15,14 @@ Hooks.on("ready", function() { }); Hooks.on("preCreateScene", function(scene, data, options) { - // With 0.8.0's document change, we need to update the scene's data differently - // Include backwards compatibility for now - // Note: This hook's parameters changed from {data, options} to {scene, data, options} - if(isNewerVersion("0.8.0", game.data.version)) { - preCreateSceneLegacy(scene, data); - return; - } - - if(!options.sdUseOriginal && !isCopy(data)) { - console.log("Scene Defaults | Replacing Defaults"); - const preset = Settings.getActivePresetData(); - const newData = mergeObject(data, preset, { - insertKeys: true, - insertValues: true, - overwrite: true, - inplace: false - }); + console.log("Scene Defaults | Replacing Defaults"); + const preset = Settings.getActivePresetData(); + const newData = mergeObject(data, preset, { + insertKeys: true, + insertValues: true, + overwrite: true, + inplace: false + }); - scene.data.update(newData); - } + scene.updateSource(newData); }); - -function preCreateSceneLegacy(data, options) { - if(!options.sdUseOriginal && !isCopy(data)) { - console.log("Scene Defaults | Replacing Defaults"); - const newData = Settings.getActivePresetData(); - mergeObject(data, newData, true, true, true); - } -}; \ No newline at end of file