From 3c5558ed8cedbd11b27f4c1899fadcf7702db6c7 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 21 Dec 2019 08:52:18 -0500 Subject: [PATCH] Fix volumes being cubic meters, not liters, in the creation screen This involves dividing inputs by 1000 when starting the game and multiplying by 1000 to get back to the original settings. This does not require a migration; although it does change the behavior of saves, it changes the behavior to what people expected in the first place --- game.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/game.js b/game.js index 181639b..329e246 100644 --- a/game.js +++ b/game.js @@ -1346,6 +1346,7 @@ let macro = //macro controls every customizable part of the players body "fillFemcum": function(self) { self.femcumStorage.amount += self.femcumStorage.limit * self.baseFemcumProduction * fillPeriod / 1000; + console.log(self.femcumStorage.limit * self.baseFemcumProduction * fillPeriod / 1000); if (self.femcumStorage.amount > self.femcumStorage.limit) self.arouse(1 * (self.femcumStorage.amount / self.femcumStorage.limit - 1)); setTimeout(function () { self.fillFemcum(self); }, fillPeriod); @@ -4822,6 +4823,8 @@ function generateSettings(diff=false) { else if (form[i].type == "number") { if (form[i].dataset.unit == "percentage") { settings[form[i].name] = parseFloat(value) / 100; + } else if (form[i].dataset.unit == "volume") { + settings[form[i].name] = parseFloat(value) / 1000; } else { settings[form[i].name] = parseFloat(value); } @@ -4882,6 +4885,11 @@ function recurseDeletePanel(settings, panel) { if (option.unit == "percentage") { if (settings[option.id] * 100 == option.default) delete settings[option.id]; + } + + else if (option.unit == "volume") { + if (settings[option.id] * 1000 == option.default) + delete settings[option.id]; } else if (settings[option.id] == option.default && option.id != "name") { @@ -5012,6 +5020,8 @@ function loadSettings(settings = null) { else if (form[i].type == "number") { if (form[i].dataset.unit == "percentage") { form[i].value = settings[form[i].name] * 100; + } else if (form[i].dataset.unit == "volume") { + form[i].value = settings[form[i].name] * 1000; } else { form[i].value = settings[form[i].name]; }