Skip to content

Commit

Permalink
fix: don't take outdated values from .map file on load
Browse files Browse the repository at this point in the history
  • Loading branch information
Azgaar committed Aug 9, 2023
1 parent b0887b1 commit 71cc739
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8004,8 +8004,8 @@
<script defer src="libs/rgbquant.min.js"></script>
<script defer src="libs/jquery.ui.touch-punch.min.js"></script>

<script defer src="modules/io/save.js?v=1.90.00"></script>
<script defer src="modules/io/load.js?v=1.91.03"></script>
<script defer src="modules/io/save.js?v=1.91.04"></script>
<script defer src="modules/io/load.js?v=1.91.04"></script>
<script defer src="modules/io/cloud.js"></script>
<script defer src="modules/io/export.js?v=1.89.36"></script>
<script defer src="modules/io/formats.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions modules/io/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ async function parseLoadedData(data) {
if (settings[18]) precInput.value = precOutput.value = settings[18];

if (settings[19]) options = JSON.parse(settings[19]);
// setting 16 and 17 (temperature) are part of options now
if (settings[16]) options.temperatureEquator = Number(settings[16]);
if (settings[17]) options.temperatureNorthPole = options.temperatureSouthPole = Number(settings[17]);
// setting 16 and 17 (temperature) are part of options now, kept as "" in newer versions for compatibility
if (settings[16]) options.temperatureEquator = +settings[16];
if (settings[17]) options.temperatureNorthPole = options.temperatureSouthPole = +settings[17];

if (settings[20]) mapName.value = settings[20];
if (settings[21]) hideLabels.checked = +settings[21];
Expand Down
4 changes: 2 additions & 2 deletions modules/io/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function getMapData() {
urbanization,
mapSizeOutput.value,
latitudeOutput.value,
0, // previously used for temperatureEquatorOutput.value
0, // previously used for tempNorthOutput.value
"", // previously used for temperatureEquatorOutput.value
"", // previously used for tempNorthOutput.value
precOutput.value,
JSON.stringify(options),
mapName.value,
Expand Down
2 changes: 1 addition & 1 deletion versioning.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

// version and caching control
const version = "1.91.03"; // generator version, update each time
const version = "1.91.04"; // generator version, update each time

{
document.title += " v" + version;
Expand Down

0 comments on commit 71cc739

Please sign in to comment.