From fb2c7eda1dd82c0b2fd0e801f8d48e27eb7a15c9 Mon Sep 17 00:00:00 2001 From: pregmodfan <pregmodfan@cock.li> Date: Wed, 14 Nov 2018 22:54:58 +0200 Subject: [PATCH] fixed backward compatibility call for genetic (wombJS side only) --- src/js/wombJS.tw | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/js/wombJS.tw b/src/js/wombJS.tw index 8b0c639de99..0b8ff87ea1d 100644 --- a/src/js/wombJS.tw +++ b/src/js/wombJS.tw @@ -29,12 +29,6 @@ $slave.bellyPreg = WombGetWolume($slave) - return double, with current womb volu //Init womb system. window.WombInit = function(actor) { - if (typeof actor != "object") - { - console.log("WombInit - actor is not object!"); - return; - } - if (!Array.isArray(actor.womb)) { //alert("creating new womb"); //debugging actor.womb = []; @@ -53,10 +47,11 @@ window.WombInit = function(actor) { //backward compatibility setup. Fully accurate for normal pregnancy only. if (actor.womb.length > 0 && actor.broodmother == 0 && actor.womb[0].genetics == undefined) { - var i; - for (i=0; i<actor.womb.length; i++) { - ft.genetics = generateGenetics(actor.ID, actor.pregSource, i+1); - } + var i=0 + actor.womb.forEach(function(ft){ + ft.genetics = generateGenetics(actor.ID, actor.pregSource, i); + i++; + }); } else if (actor.womb.length == 0 && actor.pregType != 0 && actor.broodmother == 0) { WombImpregnate(actor, actor.pregType, actor.pregSource, actor.preg); } else if (actor.womb.length == 0 && actor.pregType != 0 && actor.broodmother > 0 && actor.broodmotherOnHold < 1) { -- GitLab