# npcpreservec
!! {It expects an Args containing a C array index}
!! {This initializes the array and acts as a gate to deny bad calls.}
$npctemp = $ARGS[0]

if mid($npctemp,1,1) = 'C':
	:npcsavebsanityloop
	i = 0
	$npclastsaved = 'B' + '<<barraynumber>>'
	$npctemparrb = 'B' + '<<(barraynumber)-(1)>>'
	if $npc_PersType[$npctemparrb] = '' and barraynumber > 0:
		barraynumber -= 1
		i = 1
	elseif $npc_PersType[$npclastsaved] = '':
		i = 0
	else
		barraynumber += 1
		i = 1
	end
	if i = 1: jump 'npcsavebsanityloop'
	barraynumber += 1
	
	! {This copies the array from Array C to Array B}
	$npc_firstname[$npclastsaved] = $npc_firstname[$npctemp]
	$npc_nickname[$npclastsaved] = $npc_nickname[$npctemp]
	$npc_lastname[$npclastsaved] = $npc_lastname[$npctemp]
	$npc_usedname[$npclastsaved] = $npc_usedname[$npctemp]
	$npc_notes[$npclastsaved] = $npc_notes[$npctemp]
	npc_dob[$npclastsaved] = npc_dob[$npctemp]
	npc_vital[$npclastsaved] = npc_vital[$npctemp]
	npc_stren[$npclastsaved] = npc_stren[$npctemp]
	npc_intel[$npclastsaved] = npc_intel[$npctemp]
	npc_agil[$npclastsaved] = npc_agil[$npctemp]
	npc_sprt[$npclastsaved] = npc_sprt[$npctemp]
	npc_magik[$npclastsaved] = npc_magik[$npctemp]
	npc_drunk[$npclastsaved] = npc_drunk[$npctemp]
	npc_pantys[$npclastsaved] = npc_pantys[$npctemp]
	npc_cyc[$npclastsaved] = npc_cyc[$npctemp]
	npc_fert[$npclastsaved] = npc_fert[$npctemp]
	$npc_firstpart[$npclastsaved] = $npc_firstpart[$npctemp]
	$npc_lastpart[$npclastsaved] = $npc_lastpart[$npctemp]
	$npc_kidpater[$npclastsaved] = $npc_kidpater[$npctemp]
	npc_gender[$npclastsaved] = npc_gender[$npctemp]
	$npc_thdick[$npclastsaved] = $npc_thdick[$npctemp]
	npc_dick[$npclastsaved] = npc_dick[$npctemp]
	npc_sexskill[$npclastsaved] = npc_sexskill[$npctemp]
	npc_spermpot[$npclastsaved] = npc_spermpot[$npctemp]
	npc_vag[$npclastsaved] = npc_vag[$npctemp]
	npc_ass[$npclastsaved] = npc_ass[$npctemp]
	npc_hymen[$npclastsaved] = npc_hymen[$npctemp]
	npc_horny[$npclastsaved] = npc_horny[$npctemp]
	npc_Pavrep[$npclastsaved] = npc_Pavrep[$npctemp]
	npc_Godrep[$npclastsaved] = npc_Godrep[$npctemp]
	npc_apprnc[$npclastsaved] = npc_apprnc[$npctemp]
	npc_lipbalm[$npclastsaved] = npc_lipbalm[$npctemp]
	npc_makeup[$npclastsaved] = npc_makeup[$npctemp]
	npc_sweat[$npclastsaved] = npc_sweat[$npctemp]
	npc_dye[$npclastsaved] = npc_dye[$npctemp]
	npc_hairbsh[$npclastsaved] = npc_hairbsh[$npctemp]
	npc_skin[$npclastsaved] = npc_skin[$npctemp]
	npc_bodyhair[$npclastsaved] = npc_bodyhair[$npctemp]
	npc_breath[$npclastsaved] = npc_breath[$npctemp]
	npc_hipcurv[$npclastsaved] = npc_hipcurv[$npctemp]
	npc_hgt[$npclastsaved] = npc_hgt[$npctemp]
	npc_bust[$npclastsaved] = npc_bust[$npctemp]
	npc_nips[$npclastsaved] = npc_nips[$npctemp]
	npc_fat[$npclastsaved] = npc_fat[$npctemp]
	npc_pubes[$npclastsaved] = npc_pubes[$npctemp]
	npc_hairlng[$npclastsaved] = npc_hairlng[$npctemp]
	npc_haircol[$npclastsaved] = npc_haircol[$npctemp]
	npc_haircurl[$npclastsaved] = npc_haircurl[$npctemp]
	npc_tan[$npclastsaved] = npc_tan[$npctemp]
	npc_lip[$npclastsaved] = npc_lip[$npctemp]
	npc_lashes[$npclastsaved] = npc_lashes[$npctemp]
	npc_eyesize[$npclastsaved] = npc_eyesize[$npctemp]
	npc_eyecol[$npclastsaved] = npc_eyecol[$npctemp]
	npc_dom[$npclastsaved] = npc_dom[$npctemp]
	npc_sub[$npclastsaved] = npc_sub[$npctemp]
	npc_glasses[$npclastsaved] = npc_glasses[$npctemp]
	npc_grades[$npclastsaved] = npc_grades[$npctemp]
	npc_run[$npclastsaved] = npc_run[$npctemp]
	npc_vball[$npclastsaved] = npc_vball[$npctemp]
	npc_nerd[$npclastsaved] = npc_nerd[$npctemp]
	npc_shoot[$npclastsaved] = npc_shoot[$npctemp]
	npc_sewing[$npclastsaved] = npc_sewing[$npctemp]
	npc_serving[$npclastsaved] = npc_serving[$npctemp]
	npc_chess[$npclastsaved] = npc_chess[$npctemp]
	npc_dance[$npclastsaved] = npc_dance[$npctemp]
	npc_danceero[$npclastsaved] = npc_danceero[$npctemp]
	npc_jab[$npclastsaved] = npc_jab[$npctemp]
	npc_punch[$npclastsaved] = npc_punch[$npctemp]
	npc_kick[$npclastsaved] = npc_kick[$npctemp]
	npc_def[$npclastsaved] = npc_def[$npctemp]
	npc_vokal[$npclastsaved] = npc_vokal[$npctemp]
	npc_teach[$npclastsaved] = npc_teach[$npctemp]
	npc_QW[$npclastsaved] = npc_QW[$npctemp]
	npc_rel[$npclastsaved] = npc_rel[$npctemp]
	npc_love[$npclastsaved] = npc_love[$npctemp]
	npc_job[$npclastsaved] = npc_job[$npctemp]
	npc_cloc[$npclastsaved] = npc_cloc[$npctemp]
	$npc_dad[$npclastsaved] = $npc_dad[$npctemp]
	$npc_mom[$npclastsaved] = $npc_mom[$npctemp]
	$npc_pic[$npclastsaved] = $npc_pic[$npctemp]
	npc_herpes[$npclastsaved] = npc_herpes[$npctemp]
	npc_syth[$npclastsaved] = npc_syth[$npctemp]
	npc_gon[$npclastsaved] = npc_gon[$npctemp]
	npc_chlam[$npclastsaved] = npc_chlam[$npctemp]
	npc_Hiv[$npclastsaved] = npc_Hiv[$npctemp]
	npc_genwart[$npclastsaved] = npc_genwart[$npctemp]
	npc_Thrush[$npclastsaved] = npc_Thrush[$npctemp]
	npc_Malen[$npclastsaved] = npc_Malen[$npctemp]
	npc_Chem[$npclastsaved] = npc_Chem[$npctemp]
	npc_Clothpref[$npclastsaved] = npc_Clothpref[$npctemp]
	$npc_PersType[$npclastsaved] = $npc_PersType[$npctemp]
	$npc_dna[$npclastsaved] = $npc_dna[$npctemp]

	! {This checks the miscellanious arrays for the Entry and changes it to the new Array B.}
	:npctempmloop
	npctemp2 = arrpos('$cumarrnam', $npctemp)
	if npctemp2 >= 0: $cumarrnam[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$sparrnam', $npctemp)
	if npctemp2 >= 0: $sparrnam[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$cumfthname', $npctemp)
	if npctemp2 >= 0: $cumfthname[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$cumfthnames', $npctemp)
	if npctemp2 >= 0: $cumfthnames[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$wombpotfath', $npctemp)
	if npctemp2 >= 0: $wombpotfath[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$cumfathlotto', $npctemp)
	if npctemp2 >= 0: $cumfathlotto[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$ChildFath', $npctemp)
	if npctemp2 >= 0: $ChildFath[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$ChildThFath', $npctemp)
	if npctemp2 >= 0: $ChildThFath[npctemp2] = $npclastsaved & jump 'npctempmloop'

	! {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: $pcs_firstpart = $npclastsaved
	if $pcs_lastpart = $npctemp: $pcs_lastpart = $npclastsaved
	
!!	:npctempaloop
!!	$npctemp2 = arrpos('$npc_firstpart', $npctemp)
!!	if $npc_firstpart[$npctemp2] = $npctemp: $npc_firstpart[$npctemp2] = $npclastsaved & jump 'npctempaloop'
!!	$npctemp2 = arrpos('$npc_lastpart', $npctemp)
!!	if $npc_lastpart[$npctemp2] = $npctemp: $npc_lastpart[$npctemp2] = $npclastsaved & jump 'npctempaloop'
!!	$npctemp2 = arrpos('$npc_kidpater', $npctemp)
!!	if $npc_kidpater[$npctemp2] = $npctemp: $npc_kidpater[$npctemp2] = $npclastsaved & jump 'npctempaloop'
!!	$npctemp2 = arrpos('$npc_dad', $npctemp)
!!	if $npc_dad[$npctemp2] = $npctemp: $npc_dad[$npctemp2] = $npclastsaved & jump 'npctempaloop'
!!	$npctemp2 = arrpos('$npc_mom', $npctemp)
!!	if $npc_mom[$npctemp2] = $npctemp: $npc_mom[$npctemp2] = $npclastsaved & jump 'npctempaloop'

	! {This clears the Entry in Array C}
	gs 'npccleanc', $npctemp
end
!! Preserves npclastsavedn. Giving the last numerical B array saved.
npclastsavedn = mid($npclastsaved, 2)

killvar 'npctemp2'
killvar '$npctemp2'
killvar '$npctemp'

--- npcpreservec ---------------------------------

