mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-16 17:31:24 +01:00
fix: prevent ReferenceError when loading maps before style.js loads
Check if heightmapColorSchemes is defined before accessing it to prevent race condition between load.js and style.js initialization.
This commit is contained in:
parent
428349f6fb
commit
8d7a1635f9
1 changed files with 1 additions and 1 deletions
|
|
@ -477,7 +477,7 @@ async function parseLoadedData(data, mapVersion) {
|
|||
}
|
||||
|
||||
// add custom heightmap color scheme if any
|
||||
if (heightmapColorSchemes) {
|
||||
if (typeof heightmapColorSchemes !== "undefined" && heightmapColorSchemes) {
|
||||
const oceanScheme = byId("oceanHeights")?.getAttribute("scheme");
|
||||
if (oceanScheme && !(oceanScheme in heightmapColorSchemes)) addCustomColorScheme(oceanScheme);
|
||||
const landScheme = byId("#landHeights")?.getAttribute("scheme");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue