From 3cc3c98dca1ba268a4dcf739e805fd0ffb216a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Montero=20Lamas?= Date: Tue, 26 Mar 2024 14:13:39 +0100 Subject: [PATCH] adding nautical league The distance 5.556 km = 1 league, is put on the nautical league and used the English land league 4.828 to differentiate both units. --- index.html | 1 + modules/ui/world-configurator.js | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index c8f1e540..d3654ee6 100644 --- a/index.html +++ b/index.html @@ -5150,6 +5150,7 @@ + diff --git a/modules/ui/world-configurator.js b/modules/ui/world-configurator.js index 6ebb2fb0..0f25057e 100644 --- a/modules/ui/world-configurator.js +++ b/modules/ui/world-configurator.js @@ -113,10 +113,11 @@ function editWorld() { function toKilometer(v) { if (unit === "km") return v; - else if (unit === "mi") return v * 1.60934; - else if (unit === "lg") return v * 5.556; - else if (unit === "vr") return v * 1.0668; - else if (unit === "nmi") return v * 1.852; + if (unit === "mi") return v * 1.60934; + if (unit === "lg") return v * 4.828; + if (unit === "vr") return v * 1.0668; + if (unit === "nmi") return v * 1.852; + if (unit === "nlg") return v * 5.556; return 0; // 0 if distanceUnitInput is a custom unit }