fix: check scheme before setting

This commit is contained in:
Azgaar 2024-03-24 17:53:00 +01:00
parent ff39143b84
commit af927ed345
4 changed files with 8 additions and 8 deletions

View file

@ -743,7 +743,7 @@ export function resolveVersionConflicts(version) {
const opacity = terrs.attr("opacity");
const filter = terrs.attr("filter");
const scheme = terrs.attr("scheme");
const scheme = terrs.attr("scheme") || "bright";
const terracing = terrs.attr("terracing");
const skip = terrs.attr("skip");
const relax = terrs.attr("relax");

View file

@ -456,16 +456,16 @@ async function parseLoadedData(data, mapVersion) {
{
// dynamically import and run auto-update script
const versionNumber = parseFloat(params[0]);
const {resolveVersionConflicts} = await import("../dynamic/auto-update.js?v=1.97.00");
const {resolveVersionConflicts} = await import("../dynamic/auto-update.js?v=1.97.04");
resolveVersionConflicts(versionNumber);
}
// add custom heightmap color scheme if any
if (heightmapColorSchemes) {
const oceanScheme = terrs.select("#oceanHeights").attr("scheme");
const landScheme = terrs.select("#landHeights").attr("scheme");
if (!(oceanScheme in heightmapColorSchemes)) addCustomColorScheme(oceanScheme);
if (!(landScheme in heightmapColorSchemes)) addCustomColorScheme(landScheme);
const oceanScheme = byId("oceanHeights")?.getAttribute("scheme");
if (oceanScheme && !(oceanScheme in heightmapColorSchemes)) addCustomColorScheme(oceanScheme);
const landScheme = byId("#landHeights")?.getAttribute("scheme");
if (landScheme && !(landScheme in heightmapColorSchemes)) addCustomColorScheme(landScheme);
}
{