code:
:: AC Dump

<<if (ndef $activeSlave) || ($activeSlave == 0)>>

	@@.red;ERROR:@@ AC Dump, activeSlave invalid, returnTo is '$returnTo', previous passage was '<<print previous()>>'. Please report this.

	<<link "Continue">><<goto $returnTo>><</link>> | [[Go Back|previous()]]

<<else>>

	<<silently>>

	<<set _CL = $cribs.length, _ID = $activeSlave.ID>>

	<<if $i >= 0 && $i < _CL && $cribs[$i].ID == _ID>> /* shortcut if $i is already pointing to this slave */
		<<set $cribs[$i] = $activeSlave>>
	<<else>>
		<<set $i = $cribs.findIndex(function(s) { s.ID === _ID; })>> /* find $i if exists */
		<<if $i != -1>> /* not found, so new slave */
			@@.red;ERROR:@@ $activeSlave.slaveName not found! Please report this.
		<<else>>
			<<set $cribs[$i] = $activeSlave>>
		<</if>>
	<</if>>

	<</silently>>

	<<goto $returnTo>>

<</if>>