Browse Source

Fixed number fields without units causing errors

tags/v0.7.0
Fen Dweller 7 years ago
parent
commit
e412d46f5c
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      game.js

+ 9
- 1
game.js View File

@@ -3415,7 +3415,12 @@ function updatePreview(name) {
if (scale == "")
scale = document.getElementById("scale").placeholder;

let value = document.getElementById(name).value;
let element = document.getElementById(name);

if (element == undefined)
return;

let value = element.value;
let unitType = document.getElementById(name).dataset.unit;

if (value == "")
@@ -3423,6 +3428,9 @@ function updatePreview(name) {

let result = "";

if (unitType == undefined)
return;

if (unitType == "length")
result = length(value * scale, unit);
else if (unitType == "area")


Loading…
Cancel
Save