:: Remove activeSlave [silently]

<<set _ID = $activeSlave.ID, _SL = $slaves.length>>

<<if (def _i) && (_i < _SL) && ($slaves[_i].ID == _ID)>>
	<<set _x = _i>>
<<else>>
	<<for _x = 0; _x < _SL; _x++>>
		<<if _ID == $slaves[_x].ID>>
			<<break>>
		<</if>>
	<</for>>
<</if>>

<<if _ID == $PC.pregSource>>
	<<set $PC.pregSource to 0>>
<</if>>
<<if $activeSlave.reservedChildren > 0>>
	<<set $reservedChildren -= $activeSlave.reservedChildren>>
<</if>>
<<if $PC.mother == _ID>>
	<<set $PC.mother = $missingParentID>>
	<<if $PC.father == _ID>>
		<<set $PC.father = $missingParentID>>
	<</if>>
	<<set $missingParentID-->>
<</if>>
<<if $PC.father == _ID>>
	<<set $PC.father = $missingParentID>>
	<<set $missingParentID-->>
<</if>>
<<if $PC.sisters > 0>>
	<<if areSisters($PC, $activeSlave) > 0>>
		<<set $PC.sisters-->>
	<</if>>
<</if>>
<<if $PC.daughters > 0>>
	<<if $activeSlave.father == -1 || $activeSlave.mother == -1>>
		<<set $PC.daughters-->>
	<</if>>
<</if>>

<<if _x < _SL>>
	<<for _y = 0; _y < _SL; _y++>>
		<<if _ID == $slaves[_y].pregSource>>
			<<set $slaves[_y].pregSource = 0>>
		<</if>>
		<<if $activeSlave.daughters > 0>>
			<<if $slaves[_y].mother == _ID>>
				<<set $slaves[_y].mother = $missingParentID>>
			<</if>>
			<<if $slaves[_y].father == _ID>>
				<<set $slaves[_y].father = $missingParentID>>
			<</if>>
			<<if $incubator > 0>>
				<<for _z to 0; _z < $tanks.length; _z++>>
					<<if _ID == $tanks[_z].mother>>
						<<set $slaves[_z].mother = $missingParentID>>
					<</if>>
					<<if _ID == $tanks[_z].father>>
						<<set $slaves[_z].father = $missingParentID>>
					<</if>>
				<</for>>
			<</if>>
			<<set $missingParentID-->>
		<</if>>
		<<if $activeSlave.mother > 0 || $activeSlave.father > 0>>
			<<if $activeSlave.mother == $slaves[_y].ID || $activeSlave.father == $slaves[_y].ID>>
				<<set $slaves[_y].daughters-->>
			<</if>>
			<<set $missingParentID-->>
		<</if>>
		<<if $activeSlave.sisters > 0>>
			<<if areSisters($activeSlave, $slaves[_y]) > 0>>
				<<set $slaves[_y].sisters-->>
			<</if>>
		<</if>>
		<<if $slaves[_y].ID == $activeSlave.relationTarget>>
			<<set $slaves[_y].relation = 0, $slaves[_y].relationTarget = 0>>
		<</if>>
		<<if $slaves[_y].milkSource != 0>>
			<<if $slaves[_y].milkSource == _ID>>
				<<set $slaves[_y].milkSource =0, $slaves[_y].inflation = 0, $slaves[_y].inflationType = "none", $slaves[_y].inflationMethod = 0>>
			<</if>>
		<</if>>
		<<if $slaves[_y].cumSource != 0>>
			<<if $slaves[_y].cumSource == _ID>>
				<<set $slaves[_y].cumSource = 0, $slaves[_y].inflation = 0, $slaves[_y].inflationType = "none", $slaves[_y].inflationMethod = 0>>
			<</if>>
		<</if>>
		<<if $slaves[_y].ID == $activeSlave.relationshipTarget>>
			<<set $slaves[_y].relationship = 0, $slaves[_y].relationshipTarget = 0>>
		<</if>>
		<<if $slaves[_y].ID == $activeSlave.rivalryTarget>>
			<<set $slaves[_y].rivalry = 0, $slaves[_y].rivalryTarget = 0>>
		<</if>>
	<</for>>
	<<if _ID == $Recruiter.ID>><<set $Recruiter = 0>><</if>>
	<<if _ID == $HeadGirl.ID>><<set $HeadGirl = 0>><</if>>
	<<if _ID == $Bodyguard.ID>><<set $Bodyguard = 0>><</if>>
	<<if _ID == $Lurcher.ID>><<set $Lurcher = 0>><</if>>
	<<if _ID == $retiree.ID>><<set $retiree = 0>><</if>>
	<<if _ID == $fighterTwo.ID>><<set $fighterTwo = 0>><</if>>
	<<if _ID == $Madam.ID>><<set $Madam = 0>><</if>>
	<<if _ID == $DJ.ID>><<set $DJ = 0>><</if>>
	<<if _ID == $Milkmaid.ID>><<set $Milkmaid = 0>><</if>>
	<<if _ID == $Schoolteacher.ID>><<set $Schoolteacher = 0>><</if>>
	<<if _ID == $Attendant.ID>><<set $Attendant = 0>><</if>>
	<<if _ID == $Nurse.ID>><<set $Nurse = 0>><</if>>
	<<if _ID == $Collectrix.ID>><<set $Collectrix = 0>><</if>>
	<<if _ID == $Stewardess.ID>><<set $Stewardess = 0>><</if>>
	<<if _ID == $Wardeness.ID>><<set $Wardeness = 0>><</if>>
	<<if _ID == $Concubine.ID>><<set $Concubine = 0>><</if>>
	<<if _ID == $personalAttention>>
	<<if $PC.career == "servant">>
		<<set $personalAttention = "upkeep">>
	<<elseif $PC.career == "escort">>
		<<set $personalAttention = "whoring">>
	<<else>>
	<<set $personalAttention = "business">>
	<</if>>
	<</if>>
	<<for _y = 0; _y < $fighterIDs.length; _y++>>
		<<if _ID == $fighterIDs[_y]>>
			<<set _dump = $fighterIDs.deleteAt(_y), _y-->>
		<</if>>
	<</for>>
	/% Remove from facility array if assigned %/
	<<switch $slaves[_x].assignment>>
	<<case "learn in the schoolroom" "get treatment in the clinic" "rest in the spa" "work in the dairy" "be confined in the arcade" "live with your Head Girl" "be confined in the cellblock" "serve in the club" "serve in the master suite" "work as a servant" "work in the brothel">>
		<<removeJob $activeSlave $activeSlave.assignment>>
	<</switch>>

	<<set _Tcount = $slavesOriginal.length>>
	<<for _y = 0; _y < _Tcount; _y++>>
		<<if $slavesOriginal[_y].ID == _ID>>
			<<set _dump = $slavesOriginal.deleteAt(_y)>>
			<<break>>
		<</if>>
	<</for>>
	<<set _dump = $slaves.deleteAt(_x), _SL--, $activeSlave = 0>>
<</if>>
