Skip to content
Snippets Groups Projects
Commit 52f6e745 authored by pregmodfan's avatar pregmodfan
Browse files

removeActiveSlave will now correctly clean another slaves fetuses father ID's

parent f86375bb
No related branches found
No related tags found
No related merge requests found
......@@ -2748,4 +2748,9 @@ WombUpdatePregVars($activeSlave) - automaticaly update $activeSlave.preg, $activ
WombNormalizePreg($activeSlave) - automatialy correct all pregnancy related properties of given $activeSlave. Also it advance pregnancy if detected old .preg++ method used on slave and womb simulation is late. Can be called at any time without conditions checks - function do all needed checks by itself. Call of this function do NOT advance pregnancy by itself.
P.S. All this womb system can be much more automated (.preg .pregType .pregSource .pregWeek may have to be done in a way, that they will have no need to be controlled manually anywhere at all. Just will be set fully automatially). But in this case many changes in present game code needed, to REMOVE legacy code.
WombZeroID($activeSlave, _SlaveID) - automaticaly scan all fetuses and if their father ID matched - it will be replaced with zero. After it actor pregnancy related variables (like .pregSource) will be updated. Used mainly in process of removing slaves from game, to clean father's ID of unborn children of remaining slaves.
All this womb system can be much more automated (.preg .pregType .pregSource .pregWeek may have to be done in a way, that they will have no need to be controlled manually anywhere at all. Just will be set fully automatially). But in this case many changes in present game code needed, to REMOVE legacy code.
Right now they are set correctly, based on state of .womb object through pregnancy, but not outside. Also old style pregnancy initiation (setting only .preg to >0 and .pregType to >=1 ) working too - WombImpregnantion function for proper setup of .womb will be called on next SetBellySize call. Also old style pregnancy progression through using .preg++ is supported too, but can have minor issues with character descriptions in some cases, if SetBellySize widget not called before descriptions widgets.
......@@ -290,3 +290,17 @@ window.WombNormalizePreg = function(actor)
actor.bellyPreg = WombGetVolume(actor);
}
window.WombZeroID = function(actor, id)
{
WombInit(actor);
var i, ft;
for (i in actor.womb)
{
ft = actor.womb[i];
if (ft.fatherID == id)
ft.fatherID = 0;
}
WombNormalizePreg(actor);
}
......@@ -41,9 +41,7 @@
<</for>>
<</if>>
<<for _y = 0; _y < _SL; _y++>>
<<if _ID == $slaves[_y].pregSource>>
<<set $slaves[_y].pregSource = 0>>
<</if>>
<<set WombZeroID($slaves[_y], _ID)>> /* This check is complex, should be done in JS now, all needed will be done here. */
<<if $activeSlave.daughters > 0>>
<<if $slaves[_y].mother == _ID>>
<<set $slaves[_y].mother = $missingParentID>>
......
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