# saveupdater

if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080202:

	Msg 'Your save comes from some of previous versions of the game.<br>If it comes from ver. 0.8.1 or older, be prepare to buy new clothes.'
	if housr = 1:
		home_owned[1] = 1
	elseif housr = 2:
		home_owned[4] = 1
	end
	if BuyHous = 1: home_owned[1] = 2
	if placeMansion > 0: home_owned[5] = placeMansion
	if dachaest > 0: home_owned[3] = dachaest
	killvar 'placemansion'
	killvar 'dachaest'
	killvar 'housr'
	killvar 'BuyHous'

	if alko < 0: alko = 0
	if pranik < 0: pranik = 0
	if poroshok < 0: poroshok = 0


	!! set $home_town variable and remove consequential obsolete variables
	if $home_town = '':
		gs 'set_home', curr_home
		killvar 'svidboykino'
		killvar 'svidboypark'
		killvar 'svidboypark1'
		killvar 'svidboypark2'
		killvar 'svidboykafe'
	end

	!! exhibition to inhib
	if pcs_exhibition ! 0:
		pcs_inhib = pcs_exhibition
		inhib_exp = exhibition_exp
		inhib_lvlst = pcs_exhibition
		inhib_lvl = pcs_exhibition
		killvar 'pcs_exhibition'
		killvar 'exhibition_exp'
	end

	!! adds pregnancy progression images to saves that did not have them previously.
	if arrsize('$bodimgsets') = 30:
		$bodimgsets[30] = 'pregnant, but not showing'
		$bodimgsets[31] = 'glowing'
		$bodimgsets[32] = 'starting to show'
		$bodimgsets[33] = 'clearly showing'
		$bodimgsets[34] = 'fairly pregnant'
		$bodimgsets[35] = 'quite pregnant'
		$bodimgsets[36] = 'very pregnant'
		$bodimgsets[37] = 'extremely pregnant'
		$bodimgsets[38] = 'ready to pop'
		$bodimgsets[39] = 'default_preg'
	end

	!! reorganizes old spell variables into new arrrays
	if spell_update = 0:
		spell_update = 1

		if spelltuman = 1:spellKnown['fog'] = 1
		if spellklon = 1:spellKnown['clone'] = 1
		if spellstun = 1:spellKnown['stun'] = 1
		if spellweap = 1:spellKnown['weapon'] = 1
		if spellwind = 1:spellKnown['wind'] = 1
		if spellklon2 = 1:spellKnown['multiclone'] = 1
		if spellinit = 1:spellKnown['haste'] = 1
		if spellhel = 1:spellKnown['heal'] = 1
		if spellfire0 = 1:spellKnown['scaldingtouch'] = 1
		if spellfire2 = 1:spellKnown['burninghands'] = 1
		if spellfire3 = 1:spellKnown['firebarrier'] = 1
		if spellfire4 = 1:spellKnown['firestorm'] = 1
		if spellfire5 = 1:spellKnown['flameshield'] = 1
		if spellele0 = 1:spellKnown['shock'] = 1
		if spellele2 = 1:spellKnown['lightning'] = 1
		if spellele3 = 1:spellKnown['electricbarrier'] = 1
		if spellele4 = 1:spellKnown['1000birds'] = 1
		if spellele5 = 1:spellKnown['dancingsphere'] = 1
		if spellert0 = 1:spellKnown['quicksand'] = 1
		if spellert2 = 1:spellKnown['earthshield'] = 1
		if spellert3 = 1:spellKnown['abyss'] = 1
		if spellert4 = 1:spellKnown['earthguardian'] = 1
		if spellert5 = 1:spellKnown['sando'] = 1
		if spellwind0 = 1:spellKnown['windgust'] = 1
		if spellwind2 = 1:spellKnown['pressure'] = 1
		if spellwind3 = 1:spellKnown['vacuum'] = 1
		if spellwind4 = 1:spellKnown['vacuumshells'] = 1
		if spellwind5 = 1:spellKnown['devouringvacuum'] = 1
		if spellwater0 = 1:spellKnown['leechmana'] = 1
		if spellwater2 = 1:spellKnown['flood'] = 1
		if spellwater3 = 1:spellKnown['blister'] = 1
		if spellwater4 = 1:spellKnown['sharkrockets'] = 1
		if spellwater5 = 1:spellKnown['greatflood'] = 1
	end

	if spell_update < 2:
		spell_update = 2
		killvar '$basicSpells'
	end
	gs 'spellList'

	if spell_update < 3:
		spell_update = 3
		! Fix Spell learn avaiability for Kakuzu if needed
		if tobiQW = 3:
			if stihia = 1:
				gs 'spellList','addAvailableSpells','fireSpells', 20
			end
			if stihia = 2:
				gs 'spellList','addAvailableSpells','electSpells', 20
			end
			if stihia = 3:
				gs 'spellList','addAvailableSpells','earthSpells', 20
			end
			if stihia = 4:
				gs 'spellList','addAvailableSpells','airSpells', 20
			end
			if stihia = 5:
				gs 'spellList','addAvailableSpells','waterSpells', 20
			end
		end
		! Fix Library spells found if needed
		if arrsize('$ResearchingSP')>0:
			gs 'spellList','addAvailableSpells','librarySpells', arrsize('$ResearchingSP')
		end
	end
	gs 'spellList'


	if array_updater = 0:
		array_updater = 1
		$oldnpcvars[0] = 'npc_app'
		$oldnpcvars[1] = 'npc_hair'
		$oldnpcvars[2] = 'npc_int'
		$oldnpcvars[3] = 'npc_lipstick'
		$oldnpcvars[4] = 'npc_mag'
		$oldnpcvars[5] = 'npc_undies'
		$oldnpcvars[6] = 'npc_Qstlvl'
		$oldnpcvars[7] = 'npc_spirit'
		$oldnpcvars[8] = 'npc_str'
		$oldnpcvars[9] = 'npc_vit'
		
		$newnpcvars[0] = 'npc_apprnc'
		$newnpcvars[1] = 'npc_hairbsh'
		$newnpcvars[2] = 'npc_intel'
		$newnpcvars[3] = 'npc_lipbalm'
		$newnpcvars[4] = 'npc_magik'
		$newnpcvars[5] = 'npc_pantys'
		$newnpcvars[6] = 'npc_QW'
		$newnpcvars[7] = 'npc_sprt'
		$newnpcvars[8] = 'npc_stren'
		$newnpcvars[9] = 'npc_vital'

		i = 0
		:npcvarloop
		$oldnpcvar = $oldnpcvars[i]
		if i < arrsize($oldnpcvars):
			if 1 > arrsize('oldnpcvar'):i += 1 & jump 'npcvarloop'
			$newnpcvar = $newnpcvars[i]
			COPYARR 'newnpcvar', 'oldnpcvar'
			i += 1
			jump 'npcvarloop'
		end
		killvar 'npc_app'
		killvar 'npc_hair'
		killvar 'npc_int'
		killvar 'npc_lipstick'
		killvar 'npc_mag'
		killvar 'npc_undies'
		killvar 'npc_Qstlvl'
		killvar 'npc_spirit'
		killvar 'npc_str'
		killvar 'npc_vit'
		killvar 'oldnpcvar'
		killvar 'newnpcvar'
		killvar '$oldnpcsvars'
		killvar '$newnpcvars'
	end

	!!Updates for the old school code
	if NatBelLernQW > 0 and NatbelQW['QWstage'] = 0: NatbelQW['QWstage'] = NatBelLernQW & NatBelLernQW = 0


	if npc_grupTipe['A133'] = 0: npc_grupTipe['A133'] = 6
	if grupTipe[25] ! 0: 
		if npc_grupTipe['A25'] = 0: npc_grupTipe['A25'] = grupTipe[25]
		grupTipe[25] = 0
	end
	if grupTipe[5] ! 0: 
		if npc_grupTipe['A5'] = 0: npc_grupTipe['A5'] = grupTipe[5]
		grupTipe[5] = 0
	end
	if grupTipe[61] ! 0: 
		if npc_grupTipe['A189'] = 0: npc_grupTipe['A189'] = grupTipe[61]
		grupTipe[61] = 0
	end

	if npcSex[1] > 0: npcSex[1] = 0 & npc_sex['A1'] = 1
	if npcSex[2] > 0: npcSex[2] = 0 & npc_sex['A2'] = 1
	if npcSex[3] > 0: npcSex[3] = 0 & npc_sex['A3'] = 1
	if npcSex[4] > 0: npcSex[4] = 0 & npc_sex['A4'] = 1
	if npcSex[6] > 0: npcSex[6] = 0 & npc_sex['A6'] = 1
	if npcSex[9] > 0: npcSex[10] = 0 & npc_sex['A9'] = 1
	if npcSex[10] > 0: npcSex[10] = 0 & npc_sex['A10'] = 1
	if npcSex[11] > 0: npcSex[11] = 0 & npc_sex['A11'] = 1
	if npcSex[14] > 0: npcSex[14] = 0 & npc_sex['A14'] = 1
	if npcSex[16] > 0: npcSex[16] = 0 & npc_sex['A16'] = 1
	if npcSex[23] > 0: npcSex[23] = 0 & npc_sex['A23'] = 1

	if telefon_rev < 2:
		killvar '$contact'
		killvar '$contactIcon'
		killvar '$contactOCode'
		killvar '$contactOSche'
		killvar '$contactICode'
		killvar '$contactISche'
		gs 'telefon', 'AddContact', 'A29', 'icon_npc1',"gs 'telefon', 'Phone_call'","hour >= 8 and hour <= 20"
		if telkat > 0:
			gs 'telefon', 'AddContact', 'A219', 'icon_kat',"$telsob = 'Kate' & gt 'telefon', 'mobilaraz'","hour >= 8 and hour <= 20"
		end
		if npc_QW['A192'] > 0:
			gs 'telefon', 'AddContact', 'A192', 'icon_nastja',"gs 'telefon', 'start'","hour >= 8 and hour <= 20"
		end
		telefon_rev = 2
	end

	if pee > 0: stat['pee'] += pee & killvar 'pee'
	! Since the arousal calls are seeded in all the scenes where these two variables occur, once they''ve been added to the stat, they should always be less or equal to it.
	if NatbelQW['pee'] > stat['pee_give']: stat['pee_give'] += NatbelQW['pee']
	if mistpiss > stat['pee_give'] - NatbelQW['pee']: stat['pee_give'] += mistpiss

	if thpic ! 0: killvar 'thpic'
	if puspic ! 0: killvar 'puspic'

	if $npcGoSchool['A<<npctemp>>'] = '<a href="exec:gt ''gschool_chats2'',''christina''"><<$npc_usedname[''A18'']>></a>': $npcGoSchool['A<<npctemp>>'] = '<a href="exec:gt ''gschool_chats1'',''christina''"><<$npc_usedname[''A18'']>></a>'


	!! Replacing some of the natasha variables with NatbelQW['QWstage'] levels.
	killvar 'natsub'
	killvar 'natotrab'
	killvar 'natfuck'


	if StoryLine = 1:

		if fuckornot_update = 0:
			fuckornot_update = 1
			hotcat_rating['A22'] = 9
			hotcat_rating['A17'] = 9
			hotcat_rating['A23'] = 8
			hotcat_rating['A144'] = 8
			hotcat_rating['A19'] = 7
			hotcat_rating['A18'] = 7
			hotcat_rating['A14'] = 7
			hotcat_rating['A12'] = 7
			hotcat_rating['A140'] = 7
			hotcat_rating['A141'] = 7
			hotcat_rating['A15'] = 7
			hotcat_rating['A143'] = 6
			hotcat_rating['A13'] = 6
			hotcat_rating['A16'] = 6
			hotcat_rating['A25'] = 6
			hotcat_rating['A139'] = 6
			hotcat_rating['A20'] = 6
			hotcat_rating['A21'] = 6
			hotcat_rating['A24'] = 5
			hotcat_rating['A142'] = 5
			hotcat_rating['A145'] = 4
		elseif fuckornot_update = 1:
			fuckornot_update = 2
			hotcat_rating['A145'] = 4
			hotcat_movement['A145'] = 0
		elseif fuckornot_update = 2:
			fuckornot_update = 3
			hotcat_rating['A1'] = 8
			hotcat_rating['A2'] = 6
			hotcat_rating['A3'] = 7
			hotcat_rating['A4'] = 5
			hotcat_rating['A5'] = 7
			hotcat_rating['A6'] = 4
			hotcat_rating['A7'] = 1
			hotcat_rating['A8'] = 7
			hotcat_rating['A9'] = 5
			hotcat_rating['A10'] = 6
			hotcat_rating['A11'] = 4
			hotcat_rating['A34'] = 7
			hotcat_rating['A58'] = 4
			hotcat_rating['A59'] = 6
			hotcat_rating['A146'] = 8
			hotcat_rating['A147'] = 8
			hotcat_rating['A148'] = 6
			hotcat_rating['A149'] = 7
			hotcat_rating['A152'] = 6
			hotcat_rating['A153'] = 4
			hotcat_rating['A154'] = 7
			hotcat_rating['A155'] = 7
			hotcat_rating['A156'] = 5
			hotcat_rating['A157'] = 5
			hotcat_rating['A158'] = 6
			hotcat_rating['A159'] = 1
		end

		if grigoryEV ! 0:
			npc_qw['A221'] = grigoryEV
			killvar 'grigoryEV'
		end

		if SchoolAtestat = 0 and SchoolBlock = 0 and $schbrand = '':$schbrand = 'school'
	end

	if wombfather_update = 0: wombfather_update = 1 & gs 'din_bad'

	!! This will unlock the Anushka photos if a player has already done the event.
	if showerphotos = 1 and showerphotosupdater = 0:
		showerphotosupdater = 1
		anushkaphoto[1] = 1
		anushkaphoto[2] = 1
		anushkaphoto[3] = 1
		anushkaphoto[4] = 1
		anushkaphoto[5] = 1
		anushkaphoto[6] = 1
	end

	!! Changes to the pregnancy due date dynamic format
	if pregdateupdate = 0:
		gs 'din_bad'
		pregdateupdate = 1
	end

	if $npc_usedname['A<<npctemp>>'] = 'Inna': $npc_usedname['A<<npctemp>>'] = 'Irina'

	!! Killing some useless variables used to trigger the Pavlin storyline
	if totalmon ! 0:
		montake = totalmon
		killvar 'totalmon'
		killvar 'mongiveback'
	end

	if cyc_update = 0:
		cyc_update = 1
		daylastperiod = firstmens
		if difficulty = 4:
			cyccustom = 0
		else
			cyccustom = 1
		end
	end

	! Switching from tracking relationship with Rex from rex to npc_rel['A57']
	if rex > 0 and rex > npc_rel['A57']: npc_rel['A57'] = rex & killvar 'rex'

	!!------------------------------village variable clean up/translation---------------------------------------
	if findvel > 0: BikeLoc = findvel & killvar 'findvel'
	!!------------------------------grandparent variable clean up---for 0.8.0 release---------------------------
	!!---Grandpa
	If grandpa_bilberry > 0: grandpaQW['chore_berry_quantity'] = grandpa_bilberry & killvar 'grandpa_bilberry'
	If grandpa_boletus > 0: grandpaQW['chore_mushroom_quantity'] = grandpa_boletus & killvar 'grandpa_boletus'
	If grandpahelpday > 0: grandpaQW['last_day_helped'] = grandpahelpday & killvar 'grandpahelpday'
	If grandpahelping > 0: grandpaQW['chore_type'] = grandpahelping & killvar 'grandpahelping'
	If grandpatalk > 0: grandpaQW['last_hour_talked'] = grandpatalk & killvar 'grandpatalk'
	If grandpatalkday > 0: grandpaQW['last_day_talked'] = grandpatalkday & killvar 'grandpatalkday'
	If grandpatalkforest > 0: grandpaQW['talked_about_forest'] = grandpatalkforest & killvar 'grandpatalkforest'
	If comb_horse > 0: grandpaQW['chore_brush_horse'] = comb_horse & killvar 'comb_horse'
	If cow_field > 0: grandpaQW['chore_lead_cow_to_field'] = cow_field & killvar 'cow_field'
	If feed_boar > 0: grandpaQW['chore_feed_boar'] = feed_boar & killvar 'feed_boar'
	If feed_cow > 0: grandpaQW['chore_feed_cow'] = feed_cow & killvar 'feed_cow'
	If feed_horse > 0: grandpaQW['chore_feed_horse'] = feed_horse & killvar 'feed_horse'
	If graze_cow > 0: grandpaQW['chore_herd_cattle'] = graze_cow & killvar 'graze_cow'
	If graze_cow_exp > 0: grandpaQW['chore_herd_cattle_experience'] = graze_cow_exp & killvar 'graze_cow_exp'
	If haying_time > 0: grandpaQW['chore_bale_hay'] = haying_time & killvar 'haying_time'
	If horse_field > 0: grandpaQW['chore_lead_horse_to_field'] = horse_field & killvar 'horse_field'
	If horse_river > 0: grandpaQW['chore_bathe_horse'] = horse_river & killvar 'horse_river'
	If go_in_bilberry > 0: grandpaQW['chore_gather_berries'] = go_in_bilberry & killvar 'go_in_bilberry'
	If go_in_boletus > 0: grandpaQW['chore_gather_mushrooms'] = go_in_boletus & killvar 'go_in_boletus'
	If go_in_boletus_bilberry > 0: grandpaQW['chore_gather_both'] = go_in_boletus_bilberry & killvar 'go_in_boletus_bilberry'
	!!---Grandma
	If grandma_trouble > 0: grandmaQW['nudity_trouble'] = grandma_trouble & killvar 'grandma_trouble'
	If grandmastory > 0: grandmaQW['last_day_asked_for_story'] = grandmastory & killvar 'grandmastory'
	If grandmatalk > 0: grandmaQW['last_hour_talked'] = grandmatalk & killvar 'grandmatalk'
	If grandmatalkday > 0: grandmaQW['last_day_talked'] = grandmatalkday & killvar 'grandmatalkday'
	If grandmatalkgad > 0: grandmaQW['talked_about_gadukino'] = grandmatalkgad & killvar 'grandmatalkgad'
	If monthbabkapay > 0: grandmaQW['last_month_paid'] = monthbabkapay & killvar 'monthbabkapay'
	If grandmahelpday > 0: grandmaQW['last_day_helped'] = grandmahelpday & killvar 'grandmahelpday'
	If grandmahelp > 0: grandmaQW['help_amount'] = grandmahelp & killvar 'grandmahelp'
	If grandmahelping > 0: grandmaQW['chore_type'] = grandmahelping & killvar 'grandmahelping'
	If collect_strawberries > 0: grandmaQW['chore_collect_strawberries'] = collect_strawberries & killvar 'collect_strawberries'
	If feed_chickens > 0: grandmaQW['chore_feed_chickens'] = feed_chickens & killvar 'feed_chickens'
	If fruit_collect > 0: grandmaQW['chore_collect_fruit'] = fruit_collect & killvar 'fruit_collect'
	If harvest_garden > 0: grandmaQW['chore_harvest_garden'] = harvest_garden & killvar 'harvest_garden'
	If milk_cow > 0: grandmaQW['chore_milk_cow'] = milk_cow & killvar 'milk_cow'
	If water_garden > 0: grandmaQW['chore_water_garden'] = water_garden & killvar 'water_garden'
	If work_garden > 0: grandmaQW['chore_work_in_garden'] = work_garden & killvar 'work_garden'
	!!---------------------------end of grandparent variable clean up---for 0.8.0 release-----------------------

	!! ----- Natasha story variables migrated to array ----- 0.8.0
	! Natasha''s mom NPC data for existing saves
	if $npc_firstname['A191'] ! 'Isabella':
		npctemp = 191
		$npc_dna['A<<npctemp>>'] = '1614037462 1959746313 1085890273 0326112989 0869737602 6676723523 3590292041'
		$npc_firstname['A<<npctemp>>'] = 'Isabella'
		$npc_nickname['A<<npctemp>>'] = 'Bella'
		$npc_lastname['A<<npctemp>>'] = 'Belova'
		$npc_usedname['A<<npctemp>>'] = 'Isabella'
		$npc_notes['A<<npctemp>>'] = 'Your classmate Natasha''s mother, Isabella Belova.'
		npc_dob['A<<npctemp>>'] = 19820922
		npc_gender['A<<npctemp>>'] = 1
		gs 'npcstaticdefaults', 'defaults'
		npc_bust['A<<npctemp>>'] = 23
	end
	killvar '$NatashaMotherName' & killvar '$NatashaMotherNickname'

	if NatashaQW > 0: 				NatbelQW['QWstage'] = NatashaQW & killvar 'NatashaQW'
	if natbelXP > 0: 				NatbelQW['natbelXP'] = natbelXP & killvar 'natbelXP'
	if NatBelBestFrend > 0: 		NatbelQW['BestFriend'] = NatBelBestFrend & killvar 'NatBelBestFrend'
	if BeInNatBelHome > 0: 			NatbelQW['VisitedHome'] = BeInNatBelHome & killvar 'BeInNatBelHome'
	if natashaFirstvisit > 0: 		NatbelQW['FirstVisit'] = natashaFirstvisit & killvar 'natashaFirstvisit'
	if NatNoTV > 0: 				NatbelQW['NoTV'] = NatNoTV & killvar 'NatNoTV'
	if ShowRand > 0: 				NatbelQW['TVshow'] = ShowRand & killvar 'ShowRand'
	if $ShowMsg ! '': 				$NatbelQW['TVmsg'] = $ShowMsg & killvar '$ShowMsg'
	if NatashaWatchedYourPorn > 0: 	NatbelQW['WatchedYourPorn'] = NatashaWatchedYourPorn & killvar 'NatashaWatchedYourPorn'
	if NatDolg > 0: 				NatbelQW['Debt'] = NatDolg & killvar 'NatDolg'
	if NatDolgDay > 0: 				NatbelQW['DebtDay'] = NatDolgDay & killvar 'NatDolgDay'
	if nattimeleft > 0: 			NatbelQW['DebtTimeLeft'] = nattimeleft & killvar 'nattimeleft'
	if NatashaMoneyGivenTimes > 0: 	NatbelQW['MoneyGivenTimes'] = NatashaMoneyGivenTimes & killvar 'NatashaMoneyGivenTimes'
	if NatashaHW > 0: 				NatbelQW['homework'] = NatashaHW & killvar 'NatashaHW'
	if natdoingHW > 0: 				NatbelQW['doingHW'] = natdoingHW & killvar 'natdoingHW'
	if NatashaNakedHW > 0: 			NatbelQW['nakedHW'] = NatashaNakedHW & killvar 'NatashaNakedHW'
	if natunderwear > 0: 			NatbelQW['underwear'] = natunderwear & killvar 'natunderwear'
	if natund > 0: 					NatbelQW['underwearShop'] = natund & killvar 'natund'
	if natseethrough > 0: 			NatbelQW['seethrough'] = natseethrough & killvar 'natseethrough'
	if natseethroughwearing > 0: 	NatbelQW['seethroughwearing'] = natseethroughwearing & killvar 'natseethroughwearing'
	if natseethroughworn > 0: 		NatbelQW['seethroughworn'] = natseethroughworn & killvar 'natseethroughworn'
	if natseehtroughkitchen > 0: 	NatbelQW['seethroughkitchen'] = natseehtroughkitchen & killvar 'natseehtroughkitchen'
	if natmomrobe > 0: 				NatbelQW['momrobe'] = natmomrobe & killvar 'natmomrobe'
	if nattraining > 0:				NatbelQW['training'] = nattraining & killvar 'nattraining'
	if natlesb > 0:					NatbelQW['lesbian'] = natlesb & killvar 'natlesb'
	if natpee > 0:					NatbelQW['pee'] = natpee & killvar 'natpee'
	if HaveCucumber > 0:			NatbelQW['cucumber'] = HaveCucumber & killvar 'HaveCucumber'
	if natkolkatease > 0:			NatbelQW['KolkaTease'] = natkolkatease & killvar 'natkolkatease'
	if kolkawantsnat > 0:			NatbelQW['KolkaWantsNat'] = kolkawantsnat & killvar 'kolkawantsnat'
	if natfuckday > 0:				NatbelQW['KolkaFuckDay'] = natfuckday & killvar 'natfuckday'
	if NatKolkaSex > 0: 			NatbelQW['KolkaSex'] = NatKolkaSex & killvar 'NatKolkaSex'
	if natbj > 0: 					NatbelQW['bj'] = natbj & killvar 'natbj'
	if NatKolkaFootjob > 0: 		NatbelQW['KolkaFootjob'] = NatKolkaFootjob & killvar 'NatKolkaFootjob'
	if natcp > 0: 					NatbelQW['KolkaCP'] = natcp & killvar 'natcp'
		! Adding all previous creampies to the new vaginal sex tracker so it can start above 0 if possible
	if NatbelQW['KolkaCP'] > 0 and NatbelQW['vaginal'] = 0: 	NatbelQW['vaginal'] += NatbelQW['KolkaCP']
	if natanal > 0: 				NatbelQW['anal'] = natanal & killvar 'natanal'
	if natpregday > 0: 				NatbelQW['pregday'] = natpregday & killvar 'natpregday'
	if nataskedbaby > 0: 			NatbelQW['askedbaby'] = nataskedbaby & killvar 'nataskedbaby'
	if natbabycount > 0: 			NatbelQW['babycount'] = natbabycount & killvar 'natbabycount'

	if MetNatMother > 0: 			NatbelQW['MetMother'] = MetNatMother & killvar 'MetNatMother'
		! These can be set to 0, so wiping them in any case to get rid of them
									NatbelQW['MotherHome'] = NatashaMotherHome & killvar 'NatashaMotherHome'
									NatbelQW['MotherDoor'] = DoorOpenBy & killvar 'DoorOpenBy'
									NatbelQW['MotherState'] = NatashaMotherState & killvar 'NatashaMotherState'
									NatbelQW['MotherStateMsg'] = NatashaMotherStateMsg & killvar 'NatashaMotherStateMsg'
									NatbelQW['MotherStateKeep'] = NatashaMotherStateKeep & killvar 'NatashaMotherStateKeep'
	if SeenNatMomHitachi > 0: 		NatbelQW['SeenNatMomHitachi'] = SeenNatMomHitachi & killvar 'SeenNatMomHitachi'
	if CaughtByNatMomHitachi > 0: 	NatbelQW['CaughtByNatMomHitachi'] = CaughtByNatMomHitachi & killvar 'CaughtByNatMomHitachi'
	if $NatMomVibName ! '': 		$NatbelQW['NatMomVibName'] = $NatMomVibName & killvar '$NatMomVibName'

		! typos found in the natasha files & other cleaning up
	if nhib_exp > 0: inhib_exp += nhib_exp & killvar 'nhib_exp'
	killvar 'natsleeprand'
	killvar 'imgrand'

	!! ----- Natasha story variables migrated to array ----- 0.8.0

	! ----- Parrot story variables migrated to array
	if saveparQW > 0:       ParrotQW['Level'] = saveparQW & killvar 'saveparQW'
	if popugai > 0:         ParrotQW['Owned1'] = popugai & killvar 'popugai'
	if popugai2 > 0:        ParrotQW['Owned2'] = popugai2 & killvar 'popugai2'
	if saveparjourQW > 0:   ParrotQW['Day'] = saveparjourQW & killvar 'saveparjourQW'
	if parbuydate > 0:      ParrotQW['BuyDate'] = parbuydate & killvar 'parbuydate'
	if sisrelparday > 0:    ParrotQW['SisterReleaseParrotDay'] = sisrelparday & killvar 'sisrelparday'
	if saveparQWfailed > 0: ParrotQW['Failed'] = saveparQWfailed & killvar 'saveparQWfailed'
	If sispopconf > 0:      ParrotQW['SisKeepParrot'] = sispopconf & killvar 'sispopconf'
	if $namepopu ! '':      $ParrotQW['Name1'] = $namepopu & killvar '$namepopu'
	if $namepopu2 ! '':     $ParrotQW['Name2'] = $namepopu2 & killvar '$namepopu2'
	! ----- Parrot story variables migrated to array

	! ----- Diner Bystroeshka (burger) story variables migrated to array
	if BankPapper > 0:         BurgerQW['BankTask'] = BankPapper & killvar 'BankPapper'
	if BistroBoss > 0:         BurgerQW['BossSlut'] = BistroBoss & killvar 'BistroBoss'
	if BistroBossDay > 0:      BurgerQW['BossSlutLastServed'] = BistroBossDay & killvar 'BistroBossDay'
	if bistroQW > 0:           BurgerQW['Level'] = bistroQW & killvar 'bistroQW'
	if $burgerIvanText ! '':   $BurgerQW['IvanSecurityCamDesc'] = $burgerIvanText & killvar '$burgerIvanText'
	if BuSWworkEnd > 0:        BurgerQW['SaunaWhoreKnown'] = BuSWworkEnd & killvar 'BuSWworkEnd'
	if dayBankPapper > 0:      BurgerQW['BankTaskDay'] = dayBankPapper & killvar 'dayBankPapper'
	if DayTerminalPapper > 0:  BurgerQW['TerminalTaskDay'] = DayTerminalPapper & killvar 'DayTerminalPapper'
	if gossipBU > 0:           BurgerQW['SlutReputation'] = gossipBU & killvar 'gossipBU'
	if IvanEvidence > 0:       BurgerQW['IvanQWEvidence'] = IvanEvidence & killvar 'IvanEvidence'
	if ivanFilmBJ > 0:         BurgerQW['IvanQWBJFilmed'] = ivanFilmBJ & killvar 'ivanFilmBJ'
	if IvanKvartira > 0:       BurgerQW['IvanQWTatianaHelp'] = IvanKvartira & killvar 'IvanKvartira'
	if IvanPodstavaDay > 0:    BurgerQW['IvanQWDay'] = IvanPodstavaDay & killvar 'IvanPodstavaDay'
	if IvanPodstavaQW > 0:     BurgerQW['IvanQW'] = IvanPodstavaQW & killvar 'IvanPodstavaQW'
	if kompromatBlackMail > 0: BurgerQW['IvanQWBlackmail'] = kompromatBlackMail & killvar 'kompromatBlackMail'
	if $kompromatFoto ! '':    $BurgerQW['IvanQWBlackmailPhoto'] = $kompromatFoto & killvar '$kompromatFoto'
	if NoBistroWork > 0:       BurgerQW['WorkBlocked'] = NoBistroWork & killvar 'NoBistroWork'
	if PersSecWork > 0:        BurgerQW['Secretary'] = PersSecWork & killvar 'PersSecWork'
	if PersSecWorkTimes > 0:   BurgerQW['SecretaryTimesWorked'] = PersSecWorkTimes & killvar 'PersSecWorkTimes'
	if PodpiskaNeviezd > 0:    BurgerQW['IvanQWPoliceDayCount'] = PodpiskaNeviezd & killvar 'PodpiskaNeviezd'
	if posuda > 0:             BurgerQW['WashDishesCount'] = posuda & killvar 'posuda'
	if posudaA > 0:            BurgerQW['WashFloorCount'] = posudaA & killvar 'posudaA'
	if posudaday > 0:          BurgerQW['WashedDishesLastDay'] = posudaday & killvar 'posudaday'
	if posudaAday > 0:         BurgerQW['WashFloorLastDay'] = posudaAday & killvar 'posudaAday'
	if PSBBtimes > 0:          BurgerQW['WorkShift'] = PSBBtimes & killvar 'PSBBtimes'
	if sergeyPQW > 0:          BurgerQW['sergeyQW'] = sergeyPQW & killvar 'sergeyPQW'
	if soplakTimes > 0:        BurgerQW['sergeyQWServiced1'] = soplakTimes & killvar 'soplakTimes'
	if soplakTimes1 > 0:       BurgerQW['sergeyQWServiced2'] = soplakTimes1 & killvar 'soplakTimes1'
	if TerminalPapper > 0:     BurgerQW['TerminalTask'] = TerminalPapper & killvar 'TerminalPapper'
	! ----- Diner Bystroeshka (burger) story variables migrated to array

	! ----- Albina story variables migrated to array
	if AlbFather > 0:          AlbinaQW['AlbFatherQW'] = AlbFather & killvar 'AlbFather'
	if AlbFrend > 0:           AlbinaQW['Friends'] = AlbFrend & killvar 'AlbFrend'
	if ZvezdEnd > 0:           AlbinaQW['StarletsShutDown'] = ZvezdEnd & killvar 'ZvezdEnd'
	if DanceWhore > 0:         AlbinaQW['StarletsWhore'] = DanceWhore & killvar 'DanceWhore'
	if beinalbinahome > 0:     AlbinaQW['KnowsHouse'] = beinalbinahome & killvar 'beinalbinahome' 
	if albsportday > 0:        AlbinaQW['SportDay'] = albsportday & killvar 'albsportday' 
	if albsporthome > 0:       AlbinaQW['SportHome'] = albsporthome & killvar 'albsporthome' 
	if gamebet > 0:            AlbinaQW['gamebet'] = gamebet & killvar 'gamebet' 
	if stardance > 0:          AlbinaQW['ShowTriggerCount'] = stardance & killvar 'stardance' 
	if albrideday > 0:         AlbinaQW['albrideday'] = albrideday & killvar 'albrideday' 
	if albinaQWdance > 0:      AlbinaQW['StarletsJoined'] = albinaQWdance & killvar 'albinaQWdance' 
	if AlbZverHelp > 0:        AlbinaQW['ChristinaHelp'] = AlbZverHelp & killvar 'AlbZverHelp' 
	if alb_father_meeting > 0: AlbinaQW['ParkRally'] = alb_father_meeting & killvar 'alb_father_meeting' 
	if alb_father_day > 0:     AlbinaQW['ParkRallyDay'] = alb_father_day & killvar 'alb_father_day' 
	if AlbFaterBlackTime > 0:  AlbinaQW['ElectionCampaignTime'] = AlbFaterBlackTime & killvar 'AlbFaterBlackTime' 
	if startletsday > 0:       AlbinaQW['startletsday'] = startletsday & killvar 'startletsday' 
	! ----- Albina story variables migrated to array

	!! Updating npc_bust[] array to the new values ----- 0.8.0
	if npc_bust['A12'] = 9: npc_bust['A12'] = 23
	if npc_bust['A13'] = 9: npc_bust['A13'] = 8
	if npc_bust['A14'] = 9: npc_bust['A14'] = 20
	if npc_bust['A15'] = 9: npc_bust['A15'] = 18
	if npc_bust['A16'] = 9: npc_bust['A16'] = 26
	if npc_bust['A17'] = 9: npc_bust['A17'] = 34
	if npc_bust['A18'] = 9: npc_bust['A18'] = 21
	if npc_bust['A19'] = 9: npc_bust['A19'] = 14
	if npc_bust['A20'] = 9: npc_bust['A20'] = 22
	if npc_bust['A21'] = 9: npc_bust['A21'] = 18
	if npc_bust['A22'] = 9: npc_bust['A22'] = 27
	if npc_bust['A23'] = 9: npc_bust['A23'] = 14
	if npc_bust['A24'] = 9: npc_bust['A24'] = 20
	if npc_bust['A25'] = 9: npc_bust['A25'] = 21
	if npc_bust['A29'] = 9: npc_bust['A29'] = 25
	if npc_bust['A30'] = 9: npc_bust['A30'] = 18
	if npc_bust['A33'] = 9: npc_bust['A33'] = 19
	if npc_bust['A134'] = 9: npc_bust['A134'] = 20
	if npc_bust['A135'] = 9: npc_bust['A135'] = 13
	if npc_bust['A136'] = 9: npc_bust['A136'] = 30
	if npc_bust['A137'] = 9: npc_bust['A137'] = 34
	if npc_bust['A138'] = 9: npc_bust['A138'] = 18
	if npc_bust['A139'] = 9: npc_bust['A139'] = 22
	if npc_bust['A140'] = 9: npc_bust['A140'] = 13
	if npc_bust['A141'] = 9: npc_bust['A141'] = 20
	if npc_bust['A142'] = 9: npc_bust['A142'] = 13
	if npc_bust['A143'] = 9: npc_bust['A143'] = 7
	if npc_bust['A144'] = 9: npc_bust['A144'] = 24
	if npc_bust['A145'] = 9: npc_bust['A145'] = 31
	!! Updating npc_bust[] array to the new values ----- 0.8.0

	!!-----------Adding pube colours for 0.8.0-----------

	if pcs_pubecol[1] = 0: pcs_pubecol = pcs_haircol & pcs_pubecol[1] = 1 & pcs_pubecol[2] = pcs_haircol

	!!-----------Adding pube colours for 0.8.0-----------

	!! ----- Mom, Luda & Olu stuff ----- 0.8.0
	killvar 'olufirst'
	killvar 'tetyafirst'
	killvar 'oluuosegunday_count'
	killvar 'oluuosegunday_day'
	!! ----- Mom, Luda & Olu stuff ----- 0.8.0

	!!trait update
	if traits['update_1'] = 0:
		traits['update_1'] = 1
		
		traits['alko_day'] = alko_trait_day 
		traits['alko_points'] = alko_trait_counter
		traits['alko_status'] = alko_trait
		
		killvar 'alko_trait_day'
		killvar 'alko_trait_counter'
		killvar 'alko_trait'
	end

	!! ----- Other bug fixes and cleanup ----- 0.8.0
	if pcs_gaming_exp > 0: gaming_exp += pcs_gaming_exp & killvar 'pcs_gaming_exp'
	if nerd_night_game ! 0: killvar 'nerd_night_game'
	if nerd_night_game_day ! 0: nerd_game['game_day'] = nerd_night_game_day & killvar 'nerd_night_game_day'

	!!Masturbation check wasn''t being cleared
	mastrOnce = 0
	!! ----- Other bug fixes and cleanup ----- 0.8.0

	!!--------0.8.0.1---school social group adjustment
	if gruptipe[9000] = 0:
		gruptipe[9000] = 1
		grupvalue[1] = grupvalue[1] * 10
		grupvalue[2] = grupvalue[2] * 10
		grupvalue[3] = grupvalue[3] * 10
		grupvalue[4] = grupvalue[4] * 10
	end
	!!--------0.8.0.1---school social group adjustment


	!!--------0.8.1--- Music variable names changed
	if ml_update_1 = 0:
		ml_guitar['hasguitar'] = ml_guitar
		ml_guitar['carried'] = ml_guitarWithMe
		ml_performance['performed_minutes'] = ml_performed_minutes
		ml_performance['max_perform_minutes'] = ml_max_perform_minutes
		ml_guitar['chordbook'] = ml_chordbook

		ml_guitarlesson['lessoncount'] = ml_lessoncount
		ml_guitarlesson['lessonday'] = ml_lessonday
		$ml_guitarlesson['lessonday'] = $ml_lessonday
		ml_guitarlesson['lessonhour'] = 15
		ml_guitarlesson['nextlesson'] = daystart + (ml_guitarlesson['lessonday'] + 7 - week)
		ml_guitarlesson['advertisement'] = ml_guitarlessonadv
		ml_guitarlesson['enquired'] = ml_enquired

		if age < 18: 
			ml_guitarlesson['lessoncost'] = 300
		else
			ml_guitarlesson['lessoncost'] = 500
		end

		killvar 'ml_guitarWithMe'
		killvar 'ml_performed_minutes'
		killvar 'ml_max_perform_minutes'
		killvar 'ml_guitarlessonadv'
		killvar 'ml_enquired'
		killvar 'ml_lessonday'
		killvar '$ml_lessonday'
		killvar 'ml_lessoncost'
		!!--------0.8.1--- Music variable names changed

		ml_update_1 = 1
	end

	!! changed $metkaM to $locM_arg and $metka to $loc_arg in the code - needed for correction saves saved prior to version 0.8.1
	if arrsize('$metkaM') > 0 or arrsize('$metka') > 0:
		$locM_arg = $metkaM
		$loc_arg = $metka
		killvar '$metkaM'
		killvar '$metka'
	end
	!!---------------------------------------------------------------

	!! fixes the variable for Christina getting outcasted, so she will show up in the journal correctly

	if zverSlutQW = 2:
		npc_grupTipe['A18'] = 5
	end

	!!---------------------------------------------------------------

	!!model age addition

	if model['age'] = 0 and model > 0:
		model['status'] = 1
		if age >= 18:
			model['age'] = age
		else
			model['age'] = 18
		end
		model = 0
	end

	!! Fixing Katja and Natasha relationship
	if npc_sex['A14'] > 1: npc_sex['A14'] = 1
	if npc_sex['A16'] > 1: npc_sex['A16'] = 1

	!! University related vars update
	if student >= 0:
		gs 'uniutil', 'transfer_legacy_vars'
	end

	!!---------------------------------------------------------------

	!! Lariska story variables migrated to array
	if KotovZverHelp > 0:    LariskaQW['VitekHelp'] = KotovZverHelp & killvar 'KotovZverHelp'
	if IvanZverHelp > 0:     LariskaQW['IvanHelp'] = IvanZverHelp & killvar 'IvanZverHelp'
	if FyodorZverHelp > 0:   LariskaQW['FedorHelp'] = FyodorZverHelp & killvar 'FyodorZverHelp'
	if lariskaHelp > 0:      LariskaQW['LariskaHelp'] = lariskaHelp & killvar 'lariskaHelp'
	if lariskaHelp_end > 0:  LariskaQw['LariskaHelpEnd'] = lariskaHelp_end & killvar 'lariskaHelp_end'
	!!---------------------------------------------------------------

	!! Lariska variables removed, no longer needed - 2020/11/30
	if beInLariskaHome = 1:
		LariskaHomeIn = 2
		killvar 'beInLariskaHome'
	end
	if doorlocked > 0: killvar 'doorlocked'
	if doorpeek > 0: killvar 'doorpeek'
	if lariskaBDSM > 0: killvar 'lariskaBDSM'
	!!---------------------------------------------------------------


	!! Shave updater
	if shave_update ! 1:
		if pubestyle = 1:
			shave_length = 2
			shave_trigger = 4
		elseif (pubestyle >= 2 and pubestyle <= 9) or pubestyle >= 12:
			shave_length = 16
			shave_trigger = 21
		elseif pubestyle = 10:
			shave_length = 26
			shave_trigger = 31
		elseif pubestyle = 11:
			shave_length = 2
			shave_trigger = 10
		end
		shave_update = 1
	end

	!! 0.8.2 clothing package for old saves ---------------------------------------

	if ARRSIZE('cheapH') > 0 or ARRSIZE('averageH') > 0 or ARRSIZE('expensiveH') > 0 or ARRSIZE('formalH') > 0 or ARRSIZE('officeH') > 0 or ARRSIZE('schoolH') > 0 or ARRSIZE('exerciseH') > 0 or ARRSIZE('uniformH') > 0 or ARRSIZE('exhibitH') > 0 or ARRSIZE('alternativeH') > 0 or ARRSIZE('fetishH') > 0 or ARRSIZE('burlesqueH') > 0:


		$batch_sell = {
			poshvalldrop += 1
			dynamic 'RESULT = <<$ARGS[0]>>H[<<ARGS[1]>>]'
			if RESULT > 100:
				dynamic '<<$ARGS[0]>>[<<ARGS[1]>>] = 0'
				dynamic '<<$ARGS[0]>>S[<<ARGS[1]>>] = 0'
				money += 750
				selltot += 750
			elseif RESULT > 45:
				dynamic '<<$ARGS[0]>>[<<ARGS[1]>>] = 0'
				dynamic '<<$ARGS[0]>>S[<<ARGS[1]>>] = 0'
				money += 500
				selltot += 500
			elseif RESULT > 30:
				dynamic '<<$ARGS[0]>>[<<ARGS[1]>>] = 0'
				dynamic '<<$ARGS[0]>>S[<<ARGS[1]>>] = 0'
				money += 300
				selltot += 300
			elseif RESULT > 0:
				dynamic '<<$ARGS[0]>>[<<ARGS[1]>>] = 0'
				dynamic '<<$ARGS[0]>>S[<<ARGS[1]>>] = 0'
				money += 100
				selltot += 100
			else
				dynamic '<<$ARGS[0]>>[<<ARGS[1]>>] = 0'
				dynamic '<<$ARGS[0]>>S[<<ARGS[1]>>] = 0'
			end
			dynamic '<<$ARGS[0]>>H[<<ARGS[1]>>] = 0'
		}


		poshvalldrop = 0
		selltot = 0

		i = 1
			:cheapmet
			if cheap[i] = 1 and cheapH[i] > 0:dynamic($batch_sell, 'cheap', i)
			i += 1
			if i <= 419:jump 'cheapmet'

			i = 1
			:averagemet
				if average[i] = 1 and averageH[i] > 0:dynamic($batch_sell, 'average', i)
				i += 1
			if i <= 541:jump 'averagemet'

			i = 1
			:expensivemet
				if expensive[i] = 1 and expensiveH[i] > 0:dynamic($batch_sell, 'expensive', i)
				i += 1
			if i <= 442:jump 'expensivemet'

			i = 1
			:formalmet
				if formal[i] = 1 and formalH[i] > 0:dynamic($batch_sell, 'formal', i)
				i += 1
			if i <= 185:jump 'formalmet'

			i = 1
			:officemet
				if office[i] = 1 and officeH[i] > 0:dynamic($batch_sell, 'office', i)
				i += 1
			if i <= 140:jump 'officemet'

			i = 1
			:schoolmet
				if school[i] = 1 and schoolH[i] > 0:dynamic($batch_sell, 'school', i)
				i += 1
			if i <= 80:jump 'schoolmet'

			i = 1
			:exercisemet
				if exercise[i] = 1 and exerciseH[i] > 0:dynamic($batch_sell, 'exercise', i)
				i += 1
			if i <= 260:jump 'exercisemet'

			i = 1
			:fetishmet
				if fetish[i] = 1 and fetishH[i] > 0:dynamic($batch_sell, 'fetish', i)
				i += 1
			if i <= 240:jump 'fetishmet'

			i = 1
			:burlesquemet
				if burlesque[i] = 1 and burlesqueH[i] > 0:dynamic($batch_sell, 'burlesque', i)
				i += 1
			if i <= 22:jump 'burlesquemet'

			i = 1
			:exhibitmet
				if exhibit[i] = 1 and exhibitH[i] > 0:dynamic($batch_sell, 'exhibit', i)
				i += 1
			if i <= 125:jump 'exhibitmet'

			i = 1
			:uniformmet
				if uniform[i] = 1 and uniformH[i] > 0:dynamic($batch_sell, 'uniform', i)
				i += 1
			if i <= 60:jump 'uniformmet'

			i = 1
			:swimwearmet
				if swimwear[i] = 1 and swimwearH[i] > 0:dynamic($batch_sell, 'swimwear', i)
				i += 1
			if i <= 213:jump 'swimwearmet'

			i = 1
			:beachmet
				if beach[i] = 1 and beachH[i] > 0:dynamic($batch_sell, 'beach', i)
				i += 1
			if i <= 103:jump 'beachmet'

			i = 1
			:alternativemet
				if alternative[i] = 1 and alternativeH[i] > 0:dynamic($batch_sell, 'alternativer', i)
				i += 1
			if i <= 129:jump 'alternativemet'

		killvar 'batch_sell'

		killvar 'alternativeH' & killvar 'alternativeS' & killvar 'alternative'
		killvar 'averageH' & killvar 'averageS' & killvar 'average'
		killvar 'burlesqueH' & killvar 'burlesqueS' & killvar 'burlesque'
		killvar 'cheapH' & killvar 'cheapS' & killvar 'cheap'
		killvar 'exerciseH' & killvar 'exerciseS'
		killvar 'exhibitH' & killvar 'exhibitS'
		killvar 'expensiveH' & killvar 'expensiveS' & killvar 'expensive'
		killvar 'fetishH' & killvar 'fetishS'
		killvar 'formalH' & killvar 'formalS' & killvar 'formal'
		killvar 'officeH' & killvar 'officeS' & killvar 'office'
		killvar 'schoolH' & killvar 'schoolS' & killvar 'school'
		killvar 'uniformH' & killvar 'uniformS' & killvar 'uniform'
		killvar 'beachS' & killvar 'beachH' & killvar 'beachB'
		killvar 'swimwearS' & killvar 'swimwearH' & killvar 'swimwearB'
		killvar 'coatS' & killvar 'coatH'

		gm_outfits[50] = 1
		gm_outfits_h[50] = 100
		gm_outfits_b[50] = pcs_hips
		gs 'clothing', 'wear', 'gm_outfits', 50
	end
end

--- saveupdater ---------------------------------

