diff --git a/src/js/wombJS.js b/src/js/wombJS.js index 23714b9481ad27e9b6aa0052434ce5cb4d14dbed..7b722795824c565f947f36b58e94bfad5b952c43 100644 --- a/src/js/wombJS.js +++ b/src/js/wombJS.js @@ -271,7 +271,7 @@ globalThis.WombGetVolume = function(actor) { // most legacy code from pregJS.tw function getCurData(actor, age) { let i = 0; - let min, max, ageMin, ageMax, rateMin, rateMax, one, rateOne, rate, cage, cSize; + let min, max, ageMin, ageMax, rateMin, rateMax, one, rateOne, rate, cAge, cSize; let data = {}; while (actor.pregData.fetusWeek[i + 1] < age && i < actor.pregData.fetusWeek.length - 1) { @@ -285,15 +285,15 @@ globalThis.WombGetVolume = function(actor) { // most legacy code from pregJS.tw rateMin = actor.pregData.fetusRate[i]; rateMax = actor.pregData.fetusRate[i + 1]; - cage = age - ageMin; + cAge = age - ageMin; one = (max - min) / (ageMax - ageMin); rateOne = (rateMax - rateMin) / (ageMax - ageMin); - rate = rateMin + (rateOne * cage); + rate = rateMin + (rateOne * cAge); - cSize = (min + (one * cage)); - // console.log("min:"+min+" max:"+max+" ageMin:"+ageMin+" ageMax:"+ageMax+" one:"+one+" rateOne:"+rateOne+" cage:"+cage+" rate:"+rate+" cSize:"+cSize+" final size:"+cSize*rate); + cSize = (min + (one * cAge)); + // console.log("min:"+min+" max:"+max+" ageMin:"+ageMin+" ageMax:"+ageMax+" one:"+one+" rateOne:"+rateOne+" cAge:"+cAge+" rate:"+rate+" cSize:"+cSize+" final size:"+cSize*rate); data.size = cSize; data.rate = rate; @@ -412,7 +412,7 @@ globalThis.FetusGetPrediction = function(actor, age) { function getCurData(actor, age) { let i = 0; - let min, max, ageMin, ageMax, rateMin, rateMax, one, rateOne, rate, cage, cSize; + let min, max, ageMin, ageMax, rateMin, rateMax, one, rateOne, rate, cAge, cSize; let data = {}; while (actor.pregData.fetusWeek[i + 1] < age && i < actor.pregData.fetusWeek.length - 1) { @@ -426,15 +426,15 @@ globalThis.FetusGetPrediction = function(actor, age) { rateMin = actor.pregData.fetusRate[i]; rateMax = actor.pregData.fetusRate[i + 1]; - cage = age - ageMin; + cAge = age - ageMin; one = (max - min) / (ageMax - ageMin); rateOne = (rateMax - rateMin) / (ageMax - ageMin); - rate = rateMin + (rateOne * cage); + rate = rateMin + (rateOne * cAge); - cSize = (min + (one * cage)); - // console.log("min:"+min+" max:"+max+" ageMin:"+ageMin+" ageMax:"+ageMax+" one:"+one+" rateOne:"+rateOne+" cage:"+cage+" rate:"+rate+" cSize:"+cSize+" final size:"+cSize*rate); + cSize = (min + (one * cAge)); + // console.log("min:"+min+" max:"+max+" ageMin:"+ageMin+" ageMax:"+ageMax+" one:"+one+" rateOne:"+rateOne+" cAge:"+cAge+" rate:"+rate+" cSize:"+cSize+" final size:"+cSize*rate); data.size = cSize; data.rate = rate;