Skip to content
Snippets Groups Projects
Commit c3627d09 authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'pregmod-master-bugfix' into 'pregmod-master'

Incubator reservation count and sanity check

See merge request pregmodfan/fc-pregmod!1725
parents 9bdcf1fe ce23c0c8
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@
<<unset _penisSize = 9>>
<<include Art_Vector_Bulge_Outfit_9>>
<<elseif _artSlave.dick >= 9>>
<<unset _penisSize = 8>
<<unset _penisSize = 8>>
<<include Art_Vector_Bulge_Outfit_8>>
<<elseif _artSlave.dick >= 8>>
<<unset _penisSize = 7>>
......
......@@ -139,4 +139,13 @@ window.setPregType = function(actor) {
}
}
return ovum;
}
window.getIncubatorReserved = function(slaves) {
var count = 0;
slaves.forEach(function(s){
if (s.reservedChildren > 0)
count += s.reservedChildren;
});
return count;
}
\ No newline at end of file
......@@ -755,7 +755,7 @@ All in all,
<<if _origReserve > 0 && _curBabies > 0>> /*Do we need incubator checks?*/
<<if _curBabies >= _origReserve>>
/*adding normal*/
<<set _cToIncub = _origReserve>>
<<set _cToIncub = _origReserve, $slaves[$i].reservedChildren = 0>>
<<elseif _curBabies < _origReserve && $slaves[$i].womb.length > 0>>
/*broodmother or partial birth, we will wait for next time to get remaining children*/
<<set $slaves[$i].reservedChildren -= _curBabies, _cToIncub = _curBabies>>
......@@ -763,7 +763,6 @@ All in all,
/*Stillbirth or something other go wrong. Correcting children count.*/
<<set $slaves[$i].reservedChildren = 0, _cToIncub = _curBabies>>
<</if>>
<<set $mom = $slaves[$i]>>
<br><br>
Of $possessive _curBabies child<<if $slaves[$i].pregType > 1>>ren<</if>>; _cToIncub <<if $slaves[$i].reservedChildren > 1>>were<<else>>was<</if>> taken to $incubatorName.
......@@ -772,7 +771,6 @@ All in all,
<<include "Incubator Workaround">>
<<set $slaves[$i].curBabies.shift()>> /*for now child generation metod for incubator not changed. But here children for incubator removed from array of birthed babies. If we decide later - we can use them for incubator as real objects here. For now they just discarded silently */
<</for>>
<<set $reservedChildren -= _cToIncub>>
<<set _curBabies = $slaves[$i].curBabies.length>>
<br><br>
<<if _curBabies > 0>>
......
......@@ -51,5 +51,7 @@ I need to break single passage to several widgets, as it's been overcomplicated
<</if>>
<</for>>
<<set $reservedChildren = getIncubatorReserved($slaves)>>
<<set $birthee = 0>>
<<set $birthed = 0>>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment