:: npcpreservec
<<set $here = 'npcpreservec'>>
<<set $ARGS = $location_var[$here]>>
<!-- !! {It expects an Args containing a C array index}-->
<!-- !! {This initializes the array and acts as a gate to deny bad calls.}-->
<<set $npctemp = $location_var[$here][0]>>
<!-- !! npcgen_lastrun is a flag to help track whether npcgeneratec or npcpreservec has been run last-->
<!-- !! npcgeneratec is 1-->
<!-- !! npcpreservec is 2-->
<<set $npcgen_lastrun = 1>>
<<if mid($npctemp,1,1) == 'C'>>
	<<warn 'JUMP MARKER ENCOUNTERED: :npcsavebsanityloop'>>
	<<set $i = 0>>
	<<set $npclastsaved = 'B' + 'barraynumber'>>
	<<set $npctemparrb = 'B' + '(barraynumber)-(1)'>>
	<<if $npc($npctemparrb).PersType == '' and getvar("$barraynumber") > 0>>
		<<set $barraynumber -= 1>>
		<<set $i = 1>>
	<<elseif $npc($npclastsaved).PersType == ''>>
		<<set $i = 0>>
	<<else>>
		<<set $barraynumber += 1>>
		<<set $i = 1>>
	<</if>>
	<<if getvar("$i") == 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump npcsavebsanityloop'>>

	<</if>>
	<<set $barraynumber += 1>>
	<!-- ! {This copies the array from Array C to Array B}-->
	<<set $npc($npclastsaved).firstname = $npc($npctemp).firstname>>
	<<set $npc($npclastsaved).nickname = $npc($npctemp).nickname>>
	<<set $npc($npclastsaved).lastname = $npc($npctemp).lastname>>
	<<set $npc($npclastsaved).usedname = $npc($npctemp).usedname>>
	<<set $npc($npclastsaved).notes = $npc($npctemp).notes>>
	<<set $npc($npclastsaved).pic = $npc($npctemp).pic>>
	<<set $npc($npclastsaved).age = $npc($npctemp).age>>
	<<set $npc($npclastsaved).dob = $npc($npctemp).dob>>
	<<set $npc($npclastsaved).gender = $npc($npctemp).gender>>
	<<set $npc($npclastsaved).height = $npc($npctemp).height>>
	<!-- ! npc_body-->
	<<set $npc($npclastsaved).haircol = $npc($npctemp).haircol>>
	<<set $npc($npclastsaved).apprnc = $npc($npctemp).apprnc>>
	<<set $npc($npclastsaved).dick = $npc($npctemp).dick>>
	<<set $npc($npclastsaved).thdick = $npc($npctemp).thdick>>
	<<set $npc($npclastsaved).bust = $npc($npctemp).bust>>
	<<set $npc($npclastsaved).dick_desc = $npc($npctemp).dick_desc>>
	<<set $npc($npclastsaved).spermpot = $npc($npctemp).spermpot>>
	<<set $npc($npclastsaved).sexskill = $npc($npctemp).sexskill>>
	<<set $npc($npclastsaved).drunk = $npc($npctemp).drunk>>
	<<set $npc($npclastsaved).horny = $npc($npctemp).horny>>
	<<set $npc($npclastsaved).rel = $npc($npctemp).rel>>
	<<set $npc($npclastsaved).love = $npc($npctemp).love>>
	<<set $npc($npclastsaved).sex = $npc($npctemp).sex>>
	<<set $npc($npclastsaved).QW = $npc($npctemp).QW>>
	<<set $npc($npclastsaved).perstype = $npc($npctemp).perstype>>
	<<set $npc($npclastsaved).dna = $npc($npctemp).dna>>
	<<set $npc($npclastsaved).herpes = $npc($npctemp).herpes>>
	<<set $npc($npclastsaved).syth = $npc($npctemp).syth>>
	<<set $npc($npclastsaved).gon = $npc($npctemp).gon>>
	<<set $npc($npclastsaved).thrush = $npc($npctemp).thrush>>
	<<set $npc($npclastsaved).residence = $npc($npctemp).residence>>
	<<set $npc($npclastsaved).apt_type = $npc($npctemp).apt_type>>
	<<set $npc($npclastsaved).apt_number = $npc($npctemp).apt_number>>
	<<set $npc($npclastsaved).apt_bedroom = $npc($npctemp).apt_bedroom>>
	<<set $npc($npclastsaved).apt_kitchen = $npc($npctemp).apt_kitchen>>
	<<set $npc($npclastsaved).apt_livingroom = $npc($npctemp).apt_livingroom>>
	<<set $npc($npclastsaved).apt_bathroom = $npc($npctemp).apt_bathroom>>
	<<set $npc($npclastsaved).apt_hall = $npc($npctemp).apt_hall>>
	<<if $npc($npclastsaved).apt_spare != ''>>
		<<set $npc($npclastsaved).apt_spare = $npc($npctemp).apt_spare>>

	<</if>>
	<<set $npc($npclastsaved).perv = $npc($npctemp).perv>>
	<<set $npc($npclastsaved).outfit = $npc($npctemp).outfit>>
	<<set $npc($npclastsaved).finance = $npc($npctemp).finance>>
	<<set $npc($npclastsaved).occupation = $npc($npctemp).occupation>>
	<<set $npc($npclastsaved).occupation = $npc($npctemp).occupation>>
	<<set $npc($npclastsaved).start_free_time = $npc($npctemp).start_free_time>>
	<<set $npc($npclastsaved).end_free_time = $npc($npctemp).end_free_time>>
	<<set $npc($npclastsaved).day_off = $npc($npctemp).day_off>>
	<<set $npc($npclastsaved).car = $npc($npctemp).car>>
	<<set $npc($npclastsaved).intel = $npc($npctemp).intel>>
	<<set $npc($npclastsaved).humor = $npc($npctemp).humor>>
	<<set $npc($npclastsaved).fav_pos = $npc($npctemp).fav_pos>>
	<<set $npc($npclastsaved).fav_pos = $npc($npctemp).fav_pos>>
	<<set $npc($npclastsaved).sex_speed = $npc($npctemp).sex_speed>>
	<<set $npc($npclastsaved).cum_pref = $npc($npctemp).cum_pref>>
	<<set $npc($npclastsaved).cum_pref = $npc($npctemp).cum_pref>>
	<<set $npc($npclastsaved).bukakke_fetish = $npc($npctemp).bukakke_fetish>>
	<<set $npc($npclastsaved).tit_pref = $npc($npctemp).tit_pref>>
	<<set $npc($npclastsaved).bush_pref = $npc($npctemp).bush_pref>>
	<<set $npc($npclastsaved).style = $npc($npctemp).style>>
	<<set $npc($npclastsaved).smoker = $npc($npctemp).smoker>>
	<<set $npc($npclastsaved).mj = $npc($npctemp).mj>>
	<<set $npc($npclastsaved).addit = $npc($npctemp).addit>>
	<<set $npc($npclastsaved).doors = $npc($npctemp).doors>>
	<<set $npc($npclastsaved).goal = $npc($npctemp).goal>>
	<!-- !!	relationship ideals/stats-->
	<<set $npc($npclastsaved).fidelity = $npc($npctemp).fidelity>>
	<<set $npc($npclastsaved).fidelity = $npc($npctemp).fidelity>>
	<<set $npc($npclastsaved).girlfriend = $npc($npctemp).girlfriend>>
	<<set $npc($npclastsaved).lover_days = 0>>
	<<set $npc($npclastsaved).lover_keys = 0>>
	<!-- !!	traits-->
	<<set $npc($npclastsaved).earlyriser = $npc($npctemp).earlyriser>>
	<<set $npc($npclastsaved).latesleeper = $npc($npctemp).latesleeper>>
	<<set $npc($npclastsaved).generous = $npc($npctemp).generous>>
	<<set $npc($npclastsaved).selfish = $npc($npctemp).selfish>>
	<<set $npc($npclastsaved).risktaker = $npc($npctemp).risktaker>>
	<<set $npc($npclastsaved).diligent = $npc($npctemp).diligent>>
	<<set $npc($npclastsaved).argumentative = $npc($npctemp).argumentative>>
	<<set $npc($npclastsaved).competitive = $npc($npctemp).competitive>>
	<<set $npc($npclastsaved).insecure = $npc($npctemp).insecure>>
	<<set $npc($npclastsaved).condom_conscious = $npc($npctemp).condom_conscious>>
	<<set $npc($npclastsaved).no_condoms = $npc($npctemp).no_condoms>>
	<<set $npc($npclastsaved).caretaker = $npc($npctemp).caretaker>>
	<<set $npc($npclastsaved).childfree = $npc($npctemp).childfree>>
	<<set $npc($npclastsaved).abusive = $npc($npctemp).abusive>>
	<<set $npc($npclastsaved).sexdrive = $npc($npctemp).sexdrive>>
	<<set $npc($npclastsaved).sex_stamina = $npc($npctemp).sex_stamina>>
	<<set $npc($npclastsaved).sex_spanker = $npc($npctemp).sex_spanker>>
	<<set $npc($npclastsaved).pussyeater = $npc($npctemp).pussyeater>>
	<<set $npc($npclastsaved).cuddler = $npc($npctemp).cuddler>>
	<<set $npc($npclastsaved).cum_cannon = $npc($npctemp).cum_cannon>>
	<<set $npc($npclastsaved).index = $npclastsaved>>
	<!-- ! {This checks the miscellanious arrays for the Entry and changes it to the new Array B.}-->
	<<warn 'JUMP MARKER ENCOUNTERED: :npctempmloop'>>
	<<set $npctemp2 = arrpos('$cumarrnam', $npctemp)>>
	<<if getvar("$npctemp2") >= 0>>
		<<setinit $cumarrnam[$npctemp2] = $npclastsaved>> 

	<</if>>
	<<set $npctemp2 = arrpos('$sparrnam', $npctemp)>>
	<<if getvar("$npctemp2") >= 0>>
		<<setinit $sparrnam[$npctemp2] = $npclastsaved>> 

	<</if>>
	<<set $npctemp2 = arrpos('$wombName', $npctemp)>>
	<<if getvar("$npctemp2") >= 0>>
		<<setinit $wombName[$npctemp2] = $npclastsaved>> 

	<</if>>
	<<set $npctemp2 = arrpos('$cumfathlotto', $npctemp)>>
	<<if getvar("$npctemp2") >= 0>>
		<<setinit $cumfathlotto[$npctemp2] = $npclastsaved>> 

	<</if>>
	<<set $npctemp2 = arrpos('$ChildFath', $npctemp)>>
	<<if getvar("$npctemp2") >= 0>>
		<<setinit $ChildFath[$npctemp2] = $npclastsaved>> 

	<</if>>
	<!-- ! {Thic checks Array A for the Entry and changes it to the new Array B. The parts commented out don't work and need to be replaced with something that does.}-->
	<<if $pcs_firstpart == $npctemp>>
		<<set $pcs_firstpart = $npclastsaved>>

	<</if>>
	<<if $pcs_lastpart == $npctemp>>
		<<set $pcs_lastpart = $npclastsaved>>

	<</if>>
	<!-- ! {This clears the Entry in Array C}-->
	<<gs 'npccleanc' $npctemp>>
<</if>>
<!-- !! Preserves npclastsavedn. Giving the last numerical B array saved.-->
<<set $npclastsavedn = mid($npclastsaved, 2)>>
<<set $npctemp2 to null>>
<<set $npctemp2 to null>>
<<set $npctemp to null>>
