Explorar el Código

Fixed number fields without units causing errors

tags/v0.7.0
Fen Dweller hace 7 años
padre
commit
e412d46f5c
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. +9
    -1
      game.js

+ 9
- 1
game.js Ver fichero

@@ -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")


Cargando…
Cancelar
Guardar