# saveupdater
!! This file is for updating save game when one variable have been replaced by another.

!! If you have replaced a variable for another, then you should first go to saveg.gsrc and update the version number as instructed there.
!! Then at the bottom of this file just after the last end add the following line:
!! if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < "new version number":
!! where "new version number" should be as instructed in the start of saveg.qsrc
!! Then add you replacement of variables after this line. You can see how this is done by looking through this file. 

!! When you do this you should always commit this file and saveg.qsrc at the same time.

if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080000:
	!!------------------------------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 pcs_traits['update_1'] = 0:
		pcs_traits['update_1'] = 1

		pcs_traits['alko_day'] = alko_trait_day
		pcs_traits['alko_points'] = alko_trait_counter
		pcs_traits['alko_status'] = alko_trait

		killvar 'alko_trait_day'
		killvar 'alko_trait_counter'
		killvar 'alko_trait'
	end
	
	if trt_cumeater = 1:pcs_traits['cumeater'] = 1 & trt_cumeater = 7

	!! ----- Other bug fixes and cleanup ----- 0.8.0
	if pcs_gaming_exp > 0: gs 'exp_gain', 'gaming', 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
end
	
if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080001:
	!!--------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
end

if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080100:
	!!--------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 variable updates
	if anastasia > 0 and anastasia['status'] = 0 and anastasia['saveupdate'] = 0:
		anastasia['status'] = anastasia
		anastasia['escort_ask'] = anastasia_escort_ask
		anastasia['model_exp'] = anastasia_mode_exp
		anastasia['sex'] = anastasiasex
		anastasia['saveupdate'] = 1
	end
	
	if foto_models['emily'] > 0 and emily['status'] = 0 and emily['saveupdate'] = 0:
		emily['status'] = foto_models['emily']
		emily['hate'] = emily_hate
		emily['model_exp'] = emily_model_exp
		emily['saveupdate'] = 1
	end
	
	if jeff > 0 and jeff['status'] = 0 and jeff['saveupdate'] = 0:
		jeff['status'] = jeff
		jeff['grope'] = jeff_grope
		jeff['movies'] = jeff_movies
		jeff['model_exp'] = jeff_model_exp
		jeff['saveupdate'] = 1
	end
	
	if krystal > 0 and krystal['status'] = 0 and krystal['saveupdate'] = 0:
		krystal['status'] = krystal['talk']
		
		krystal['saveupdate'] = 1
	end
		
	if mari > 0 and mari['status'] = 0 and mari['saveupdate'] = 0:
		mari['status'] = mari
		mari['busy'] = mari_busy
		mari['farm_shoot'] = mari_farm_shoot
		mari['cloth_shoot'] = mari_cloth_shoot
		mari['convo'] = mari_convo
		mari['sex'] = mari_sex
		mari['model_exp'] = mari_model_exp
		mari['model_ask'] = mari_modelling_exp
		mari['fakepassport'] = mari_fakepassport
		mari['saveupdate'] = 1
	end
	
	if $model['firstname'] = '':
		$model['firstname'] = $pcs_firstname
		$model['nickname'] = $pcs_nickname
		$model['lastname'] = $pcs_lastname
	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'
	!!---------------------------------------------------------------


	!! 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
end


if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080200:
	!! 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
	!! 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 = 8
		end
	end
end

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

	!! Lariska variables removed, no longer needed - 2020/11/30 - Alaratt
	!! Edited - 2021/01/19 - Alaratt
	if beInLariskaHome = 1 or LariskaHomeIn >= 1:
		if LariskaHomeIn = 1:
			LariskaQW['story'] = 4
		else
			LariskaQW['story'] = 5
		end
		killvar 'LariskaHomeIn'
		killvar 'beInLariskaHome'
	end
	if doorlocked > 0: killvar 'doorlocked'
	if doorpeek > 0: killvar 'doorpeek'
	if lariskaBDSM > 0: killvar 'lariskaBDSM'
	if lariskaMotherKnown = 1:
		LariskaQW['metAnna'] = 1
		killvar 'lariskaMotherKnown'
	end
	if LariskaProfi = 1:
		LariskaQW['volleyball'] = 1
		killvar 'LariskaProfi'
	end
	!!---------------------------------------------------------------

	!! Migrates Christina variables into an array, removes unneeded variables, and fixes the outcast issue if still needed
	!! 2021/01/19 - Alaratt
	if zverSlutQW > 0:
		if zverSlutQW = 2:
			!! Christina lost the fight and is outcasted
			christinaQW['fight'] = 1
			christinaQW['dompath'] = 7
			npc_grupTipe['A18'] = 5
		else
			!! Christina lost the fight and is prepped for outcasting
			christinaQW['fight'] = 1
			christinaQW['dompath'] = 6
		end
		killvar 'zverSlutQW'
	end

	if zverRageQW > 0:
		if zverRageQW = 10:
			!! Christina won the fight
			christinaQW['fight'] = -1
			christinaQW['subpath'] = 2
		elseif zverRageQW = 2:
			!! Christina lost the fight
			christinaQW['fight'] = 1
			christinaQW['dompath'] = 6
		else
			!! You spread rumors about Christina and she preps for fight
			christinaQW['dompath'] = 4
		end
		killvar 'zverRageQW'
	end

	if socialchg['christina_dont_care'] = 1:socialchg['christina_dont_care'] = 0
	if zverevaQW > 0:killvar 'zverevaQW'
	if LinaSlut > 0:killvar 'LinaSlut'
	if fizrukSex > 0:killvar 'fizrukSex'
	if kristinaSex > 0:killvar 'kristinaSex'

	if christinaphotos > 0:
		if christinaphotos = 3:
			!! Christina won the fight and you have not had a shower scene with her yet
			christinaQW['fight'] = -1
			christinaQW['subpath'] = 2
		elseif christinaphotos = 4:
			!! Christina won the fight and you had first shower scene with her
			christinaQW['fight'] = -1
			christinaQW['subpath'] = 3
		elseif christinaphotos = 2:
			!! You submitted to Christina and you had first shower scene with her
			christinaQW['submit'] = 1
			christinaQW['subpath'] = 3
		else
			!! You submitted to Christina but not had a shower scene with her yet
			christinaQW['submit'] = 1
			christinaQW['subpath'] = 2
		end
		killvar 'christinaphotos'
	end

	!!---------------------------------------------------------------
	
	!!Albina variables no longer needed, no sense in having them run in the background for nothing
	if AlbinaQW['ParkRallyDay'] > 0:AlbinaQW['ParkRallyDay'] = 0
	if AlbinaQW['ElectionCampaignTime'] > 0:AlbinaQW['ElectionCampaignTime'] = 0
	if AlbinaQW['AlbFatherQW']  > 1:AlbinaQW['AlbFatherQW']  = 1
	
	!!---------------------------------------------------------------
end

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

	!! Migrates kikboxing variables into an array, removes unneeded variables.
	if razradKik > 0: kickbox['sash'] = razradKik & killvar 'razradKik'
	if amatReit > 0: kickbox['advancement'] = amatReit & killvar 'amatReit'
	if kikmoney > 0: kickbox['money'] = kikmoney & killvar 'kikmoney'
	if KikWinAm > 0: kickbox['amateurWin'] = KikWinAm & killvar 'KikWinAm'
	if KikWinAmKO > 0: kickbox['amateurWinKO'] = KikWinAmKO & killvar 'KikWinAmKO'
	if KikLossAm > 0: kickbox['amateurLoss'] = KikLossAm & killvar 'KikLossAm'
	if KikLossAmKO > 0: kickbox['amateurLossKO'] = KikLossAmKO & killvar 'KikLossAmKO'
	if KikDrawAm > 0: kickbox['amateurDraw'] = KikDrawAm & killvar 'KikDrawAm'
	if amateur > 0: kickbox['amateur'] = amateur & killvar 'amateur'
	killvar 'razrand'

end

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

	!! Migrates Anushka''s brother''s quest into a array.
	if maksimQW > 0: maksimQW['QWstage'] = maksimQW

end

	!! 0.8.3 shoe package for old saves ---------------------------------------

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


	i = 1
	:sfetishmet
	if sfetish[i] = 1: money += 300
	i += 1
	if i <= 27:jump 'sfetishmet'

	i = 1
	:scatsmet
	if scats[i] = 1: money += 300
	i += 1
	if i <= 38:jump 'scatsmet'

	i = 1
	:sgandmsmet
	if sgandm[i] = 1: money += 300
	i += 1
	if i <= 40:jump 'sgandmsmet'

	i = 1
	:trainersmet
	if trainers[i] = 1: money += 300
	i += 1
	if i <= 30:jump 'trainersmet'

	i = 1
	:sboutiquemet
	if sboutique[i] = 1: money += 300
	i += 1
	if i <= 37:jump 'sboutiquemet'


	killvar 'sfetish' & killvar 'sfetishS'
	killvar 'scats' & killvar 'scatsS'
	killvar 'sgandm' & killvar 'sgandmS'
	killvar 'trainers' & killvar 'trainersS'
	killvar 'sboutique' & killvar 'sboutiqueS'


	sgm[5] = 1
	sgm_s[5] = 0
	gs 'shoes', 'wear', 'sgm', 5
end

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

	$fametown = 'pav'

	:fametownloop

	$fameact = 'acting'
	
	:fameactloop

	if dyneval('RESULT = <<$fametown>>_<<$fameact>>') < 400: 
		dynamic 'fame[''<<$fametown>>_<<$fameact>>_core''] = <<$fametown>>_<<$fameact>>'
	elseif dyneval('RESULT = <<$fametown>>_<<$fameact>>') < 1100:
		dynamic 'fame[''<<$fametown>>_<<$fameact>>_core''] = 400 + (<<$fametown>>_<<$fameact>>-400)/3'
	elseif dyneval('RESULT = <<$fametown>>_<<$fameact>>') < 2900:
		dynamic 'fame[''<<$fametown>>_<<$fameact>>_core''] = 700 + (<<$fametown>>_<<$fameact>>-1100)/6'
	else
		dynamic 'fame[''<<$fametown>>_<<$fameact>>_core''] = 1000 +(<<$fametown>>_<<$fameact>> -2900)/10'
	end
	killvar '<<$fametown>>_<<$fameact>>'


	if $fameact = 'acting':
		$fameact = 'dance'
		jump 'fameactloop'
	elseif $fameact = 'dance':
		$fameact = 'painting'
		jump 'fameactloop'
	elseif $fameact = 'painting':
		$fameact = 'music'
		jump 'fameactloop'
	elseif $fameact = 'music':
		$fameact = 'ballet'
		jump 'fameactloop'
	elseif $fameact = 'ballet':
		$fameact = 'modelling'
		jump 'fameactloop'
	elseif $fameact = 'modelling':
		$fameact = 'porn'
		jump 'fameactloop'		
	elseif $fameact = 'porn':
		$fameact = 'stripping'
		jump 'fameactloop'		
	elseif $fameact = 'stripping':
		$fameact = 'kickboxing'
		jump 'fameactloop'		
	elseif $fameact = 'kickboxing':
		$fameact = 'running'
		jump 'fameactloop'		
	elseif $fameact = 'running':
		$fameact = 'volleyball'
		jump 'fameactloop'				
	elseif $fameact = 'volleyball':
		$fameact = 'chess'
		jump 'fameactloop'			
	elseif $fameact = 'chess':
		$fameact = 'teaching'
		jump 'fameactloop'			
	elseif $fameact = 'teaching':
		$fameact = 'media'
		jump 'fameactloop'
	end
		
	$fameact = 'sex'

	:fameactloop2

	if dyneval('RESULT = <<$fametown>>_<<$fameact>>') < 400: 
		dynamic 'fame[''<<$fametown>>_<<$fameact>>''] = <<$fametown>>_<<$fameact>>'
	elseif dyneval('RESULT = <<$fametown>>_<<$fameact>>') < 1100:
		dynamic 'fame[''<<$fametown>>_<<$fameact>>''] = 400 + (<<$fametown>>_<<$fameact>>-400)/3'
	elseif dyneval('RESULT = <<$fametown>>_<<$fameact>>') < 2900:
		dynamic 'fame[''<<$fametown>>_<<$fameact>>''] = 700 + (<<$fametown>>_<<$fameact>>-1100)/6'
	else
		dynamic 'fame[''<<$fametown>>_<<$fameact>>''] = 1000 +(<<$fametown>>_<<$fameact>> -2900)/10'
	end
	killvar '<<$fametown>>_<<$fameact>>'
		
	if $fameact = 'sex':
		$fameact = 'prostitute'
		jump 'fameactloop2'		
	end
		
	if $fametown = 'pav':
		$fametown = 'city'
		jump 'fametownloop'
	elseif $fametown = 'city':
		$fametown = 'village'
		jump 'fametownloop'
	elseif $fametown = 'village':
		$fametown = 'pushkin'
		jump 'fametownloop'
	end

	gs 'fame', 'calculate', 'acting'
	gs 'fame', 'calculate', 'dance'
	gs 'fame', 'calculate', 'painting'
	gs 'fame', 'calculate', 'music'
	gs 'fame', 'calculate', 'ballet'
	gs 'fame', 'calculate', 'modelling'
	gs 'fame', 'calculate', 'porn'
	gs 'fame', 'calculate', 'stripping'
	gs 'fame', 'calculate', 'kickboxing'
	gs 'fame', 'calculate', 'running'
	gs 'fame', 'calculate', 'volleyball'
	gs 'fame', 'calculate', 'chess'
	gs 'fame', 'calculate', 'teaching'
	gs 'fame', 'calculate', 'media'
	gs 'fame', 'calculateSlut'

	if modelfoto > 0 and modelfoto['saveupdater'] = 0:
		!! changing modelling variables to arrays
		if modelfoto > 0: modelfoto['shoots'] = modelfoto
		if modelfotomoney > 0: modelfoto['earnings'] = modelfotomoney
		if modelfoto_catalog > 0: modelfoto['catalog'] = modelfoto_catalog
		if modelfoto_fashion > 0: modelfoto['fashion'] = modelfoto_fashion
		if modelfoto_ero_clo > 0: modelfoto['sexy'] = modelfoto_ero_clo
		if modelfoto_bikini > 0: modelfoto['bikini'] = modelfoto_bikini
		if modelfoto_lingerie > 0: modelfoto['lingerie'] = modelfoto_lingerie
		if modelfoto_trans_ling > 0: modelfoto['trans_ling'] = modelfoto_trans_ling
		if modelfoto_transparent > 0: modelfoto['transparent'] = modelfoto_transparent
		if modelfoto_fitness > 0: modelfoto['fitness'] = modelfoto_fitness
		if modelfoto_glamour > 0: modelfoto['glamour'] = modelfoto_glamour
		if modelfoto_topless > 0: modelfoto['topless'] = modelfoto_topless
		if modelfoto_nude > 0: modelfoto['nude'] = modelfoto_nude
		if modelfoto_tastenude > 0: modelfoto['tastenude'] = modelfoto_tastenude
		if modelfoto_toplessnude > 0: modelfoto['toplessnude'] = modelfoto_toplessnude
		if modelfoto_fullnude > 0: modelfoto['fullnude'] = modelfoto_fullnude
		if modelfoto_erotic > 0: modelfoto['erotic'] = modelfoto_erotic
		if modelfoto_nip > 0: modelfoto['nip'] = modelfoto_nip
		if modelfoto_pussy > 0: modelfoto['pussy'] = modelfoto_pussy
		if modelfoto_asshole > 0: modelfoto['asshole'] = modelfoto_asshole
		
		modelfoto['saveupdater'] = 1

	end
end

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

	!!Defines the high school classes using the new grade system
	gs 'grades', 'createclass', 'school', 'math', 3, 2, 'yes', 'yes', 0, 0
	gs 'grades', 'createclass', 'school', 'rus', 3, 2, 'yes', 'yes', 0, 0
	gs 'grades', 'createclass', 'school', 'lit', 2, 2, 'yes', 'yes', 0, 0
	gs 'grades', 'createclass', 'school', 'art', 2, 2, 'yes', 'no', 0, 0
	gs 'grades', 'createclass', 'school', 'bio', 2, 2, 'yes', 'yes', 0, 0
	gs 'grades', 'createclass', 'school', 'pe', 3, 1, 'yes', 'no', 0, 0
	gs 'grades', 'createclass', 'school', 'eng', 2, 2, 'yes', 'yes', 0, 0
	gs 'grades', 'createclass', 'school', 'geo', 2, 2, 'yes', 'yes', 0, 0
	gs 'grades', 'createclass', 'school', 'sci', 2, 2, 'yes', 'yes', 0, 0
	gs 'grades', 'createclass', 'school', 'shop', 2, 2, 'yes', 'no', 0, 0
	gs 'grades', 'createclass', 'school', 'comp', 3, 2, 'yes', 'yes', 0, 0
	gs 'grades', 'createclass', 'school', 'mus', 2, 2, 'yes', 'no', 0, 0
	gs 'grades', 'createclass', 'school', 'his', 2, 2, 'yes', 'yes', 0, 0

	!!Convert the old grade attribute into the new individual grades. 
	gs 'grades', 'grade_award', 'school', 'math', pcs_grades
	gs 'grades', 'grade_award', 'school', 'rus', pcs_grades
	gs 'grades', 'grade_award', 'school', 'lit', pcs_grades
	gs 'grades', 'grade_award', 'school', 'art', pcs_grades
	gs 'grades', 'grade_award', 'school', 'bio', pcs_grades
	gs 'grades', 'grade_award', 'school', 'pe', pcs_grades
	gs 'grades', 'grade_award', 'school', 'eng', pcs_grades
	gs 'grades', 'grade_award', 'school', 'geo', pcs_grades
	gs 'grades', 'grade_award', 'school', 'sci', pcs_grades
	gs 'grades', 'grade_award', 'school', 'shop', pcs_grades
	gs 'grades', 'grade_award', 'school', 'comp', pcs_grades
	gs 'grades', 'grade_award', 'school', 'mus', pcs_grades
	gs 'grades', 'grade_award', 'school', 'his', pcs_grades

	!!Assign a grado on the 1 to 5 russina grade scale from the grade variable
	gs 'grades', 'assing_grade_description', 'school'

	if month > 9 or (month = 9 and day > 5 and hour > 8) or year > 2016: class['first_grade_check'] = 1

end

if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080306:
	!!Moving Djibril old variables into his array

	if meet_djibril > 0: DjibrilQW['meet'] = meet_djibril & killvar 'meet_djibril'
	if djibril_invite > 0: DjibrilQW['invite'] = djibril_invite & killvar 'djibril_invite'
	if djibril_sex > 0: npc_sex['A82'] = djibril_sex & killvar 'djibril_sex'
	if african_gangbang > 0: DjibrilQW['african_gangbang'] = african_gangbang & killvar 'african_gangbang'
	if npc_sex['A82'] > 0 or DjibrilQW['african_gangbang'] > 0: DjibrilQW['invite'] = 1

end

if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080307:
	!!Moving some string variables to more appropriate numerical variables in the camera files.
	
	i = 0
	:camera_update_loop
	camera_found[i] = 1
	i += 1
	if ARRSIZE('camera_found') > i: jump 'camera_update_loop'

	!!Moved Igor''s quest to use daystart.
	
	if igor_DimaNos = 2 or igor_DimaNos = 3:
		if $igor_DimaNos_day > 5:
			igor_DimaNos_day = daystart
		else
			igor_DimaNos_day = daystart +6 - $igor_DimaNos_day
		end
	end
end


if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080402:
	!!Setting the count of generic girlfirends.

	pcs_girlfriends = 0
	i = 0
	:girlfriend_looop
	if loverGender[i] = 1: pcs_girlfriends += 1
	i +=1
	if i < ARRSIZE('lover'): jump 'girlfriend_looop'
	Killvar 'i'
	
	if analorgasm > 0: orgasm_anal += analorgasm
end

if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080403:
	!!Updating the variables for the Katja Quest line.

	if meynoldQW = 1 or meynoldQW = 2: katjaQW['QWstage'] = meynoldQW & killvar 'meynoldQW'
	if katjaFirstKiss > 0 or KatjaOTN > 0: katjaQW['QWstage'] = 3 & killvar 'katjaFirstKiss' & killvar 'KatjaOTN'
	if katjaTanga > 0: katjaQW['pantiesQWstage'] = katjaTanga & killvar 'katjaTanga'
	if katja_tanga_end > 0: katjaQW['pantiesQWstage'] = 5 & killvar 'katja_tanga_end'
	if katjaSlut > 0: katjaQW['slut'] = katjaSlut & killvar 'katjaSlut'
	if katjaHorny > 0: katjaQW['horny'] = katjaHorny & killvar 'katjaHorny'
	if katjaSex = 1: katjaQW['park_sex'] = 1 & killvar 'katjaSex'
	if katjaSex = 2: katjaQW['park_sex'] = 2 & killvar 'katjaSex'
	if katjaSex > 2: katjaQW['park_sex'] = 3 & killvar 'katjaSex'
	if KatjaMastr > 0: katjaQW['masturbates'] = KatjaMastr & killvar 'KatjaMastr'
	if KatjaThroat > 0: npc_throat['A14'] = KatjaThroat & killvar 'KatjaThroat'
	if KatjaAnus > 0: npc_ass['A14'] = KatjaAnus & killvar 'KatjaAnus'
	if KatjaOrgasm > 0: KatjaQW['orgasm_day'] = KatjaOrgasm & killvar 'KatjaOrgasm'
	if katjaMeynoldday > 0: katjaQW['afterschool_hangout_day'] = katjaMeynoldday & killvar 'katjaMeynoldday'
	if tangaday > 0: katjaQW['no_panties_day'] = tangaday & killvar 'tangaday'
	if KatjaKnowMastr > 0: katjaQW['knows_masterbation'] = 1 & killvar 'KatjaKnowMastr'
	if SelfFistingKnow > 0: katjaQW['knows_self_fisting'] = 1 & killvar 'SelfFistingKnow'
	if KatjaKnowBJ > 0: katjaQW['knows_BJ'] = 1 & killvar 'KatjaKnowBJ'
	if KatjaKnowSex > 0: katjaQW['knows_sex'] = 1 & killvar 'KatjaKnowSex'
	if KatjaKnowAnal > 0: katjaQW['knows_anal'] = 1 & killvar 'KatjaKnowAnal'
	if KatjaKnowKuni > 0: katjaQW['knows_cuni'] = 1 & killvar 'KatjaKnowKuni'
	if KatjaKnowPirsA > 0: katjaQW['know_Pirced_tongue'] = 1 & killvar 'KatjaKnowPirsA'
	if katschoolsex > 0: katja['school_sex'] = 1 & killvar 'katschoolsex'
	if katja_disco_Foto > 0: katjaQW['disco_Foto'] = 1 & killvar 'katja_disco_Foto'
	if meynoldQW = 3: katjaQW['drunk_help'] = 1 & killvar 'meynoldQW'
	if katja_disco_end > 0: katjaQW['no_panties_at_disco'] = 1 & killvar 'katja_disco_end'
	if KatjaOhrenet > 0: KatjaQW['sex_in_the_park_comment'] = KatjaOhrenet & killvar 'KatjaOhrenet'
	if flag_start_parc > 0: katjaQW['school_kiss'] = flag_start_parc & killvar 'flag_start_parc'

end

if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080500:
	if $loc = 'dorm': $loc = 'uni_dorm' & $menu_loc = 'uni_dorm'
	if $loc = 'HotelWork': $loc = 'hotel_work' & $menu_loc = 'hotel_work'
	if $loc = 'ParChurch': $loc = 'pav_church' & $menu_loc = 'pav_church'
	if $loc = 'pav_train': $loc = 'pav_market' & $menu_loc = 'pav_market'
	if $loc = 'univer': $loc = 'uni_admin' & $menu_loc = 'uni_admin'
	if $loc='youplace': $loc = 'city_mansion_entrance' & $menu_loc = 'city_mansion_entrance'
	if $loc='ykamin':   $loc ='city_mansion_residence_2' & $loc_arg='ylounge'   & $menu_loc ='city_mansion_residence_2' & $menu_arg='ylounge'
	if $loc='ykuh':     $loc ='city_mansion_residence_1' & $loc_arg='ykitchen'  & $menu_loc ='city_mansion_residence_1' & $menu_arg='ykitchen'
	if $loc='ydet':     $loc ='city_mansion_residence_2' & $loc_arg='ynursery'  & $menu_loc ='city_mansion_residence_2' & $menu_arg='ynursery'
	if $loc='ybib':     $loc ='city_mansion_residence_2' & $loc_arg='ylibrary'  & $menu_loc ='city_mansion_residence_2' & $menu_arg='ylibrary'
	if $loc='ybedr':    $loc ='city_mansion_residence_1' & $loc_arg='ybedroom'  & $menu_loc ='city_mansion_residence_1' & $menu_arg='ybedroom'
	if $loc='ybass':    $loc ='city_mansion_residence_3' & $loc_arg='ypool'     & $menu_loc ='city_mansion_residence_3' & $menu_arg='ypool'
	if $loc='yban':     $loc ='city_mansion_residence_3' & $loc_arg='ysauna'    & $menu_loc ='city_mansion_residence_3' & $menu_arg='ysauna'
	if $loc='yvan':     $loc ='city_mansion_residence_1' & $loc_arg='ybathroom' & $menu_loc ='city_mansion_residence_1' & $menu_arg='ybathroom'
	if $loc='ymans':    $loc ='city_mansion_residence_1' & $loc_arg='yfoyer'    & $menu_loc ='city_mansion_residence_1' & $menu_arg='yfoyer'
	if $loc='yzal':     $loc ='city_mansion_residence_2' & $loc_arg='yliving'   & $menu_loc ='city_mansion_residence_2' & $menu_arg='yliving'
	if $loc='ysport':   $loc ='city_mansion_residence_3' & $loc_arg='ygym'      & $menu_loc ='city_mansion_residence_3' & $menu_arg='ygym'
	if $loc='ykabinet': $loc ='city_mansion_residence_2' & $loc_arg='yoffice'   & $menu_loc ='city_mansion_residence_2' & $menu_arg='yoffice'


	!!updater for sports clothing variable to unify it and fix bug
	i = 1

	:danilovichfix
		if danilovich[i] = 1:
			danilovich_outfits[i] = 1
			danilovich_outfits_s[i] = danilovich_s[i]
			danilovich_outfits_h[i] = danilovich_h[i]
			danilovich_outfits_b[i] = danilovich_b[i]
		end
		i += 1
	if i <= 170:jump 'danilovichfix'

	killvar 'danilovich'
	killvar 'danilovich_s'
	killvar 'danilovich_h'
	killvar 'danilovich_b'

	!! New setting for gaping time per stage in minutes that can be made user definable
	if agape[4] = 0: agape[4] = 10
	if vgape[4] = 0: vgape[4] = 10
end

if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080502:
	i = 0
	:saveupdaterloop852_1
	$text = 'C'+str(i)
	temp1 = func('shortgs', 'get_me_index', '$npc_firstname',$text)
	if temp1 >= 0:
		$npc_index[$text] = $text
	end
	i += 1
	if i < carraynumber: jump 'saveupdaterloop852_1'

	i = 0
	:saveupdaterloop852_2
	$text = 'B'+str(i)
	temp1 = func('shortgs', 'get_me_index', '$npc_firstname',$text)
	if temp1 >= 0:
		$npc_index[$text] = $text
	end
	i += 1
	if i < barraynumber: jump 'saveupdaterloop852_2'
	
end

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

	i = 0
	:saveupdaterloop853_1
	if 	npc_grupTipe['A<<i>>'] = 5:
		$npcGoSchool['A<<i>>'] = '<a href="exec:gt ''gschool_outcast_chats'', ''' + $lcase($npc_usedname['A<<i>>']) + '''"><<$npc_usedname["A<<i>>"]>></a>'
	elseif npc_grupTipe['A<<i>>'] = 4:
		$npcGoSchool['A<<i>>'] = '<a href="exec:gt ''gschool_gopnik_chats'', ''' + $lcase($npc_usedname['A<<i>>']) + '''"><<$npc_usedname["A<<i>>"]>></a>'
	elseif npc_grupTipe['A<<i>>'] = 3:
		$npcGoSchool['A<<i>>'] = '<a href="exec:gt ''gschool_nerd_chats'', ''' + $lcase($npc_usedname['A<<i>>']) + '''"><<$npc_usedname["A<<i>>"]>></a>'
	elseif npc_grupTipe['A<<i>>'] = 2:
		$npcGoSchool['A<<i>>'] = '<a href="exec:gt ''gschool_jock_chats'', ''' + $lcase($npc_usedname['A<<i>>']) + '''"><<$npc_usedname["A<<i>>"]>></a>'
	elseif npc_grupTipe['A<<i>>'] = 1:
		$npcGoSchool['A<<i>>'] = '<a href="exec:gt ''gschool_coolkid_chats'', ''' + $lcase($npc_usedname['A<<i>>']) + '''"><<$npc_usedname["A<<i>>"]>></a>'
	end
	i += 1
	if i < 250: jump 'saveupdaterloop853_1'

	if hotelroom1day ! 0:
		hotelRoomDays['pav_hotel'] = hotelroom1day
		killvar'hotelroom1day'
		hotelRoom['pav_hotel'] = hotelroom
		hotelroom = 0
	end
end

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

	!!Christinas chat have to stay in the jocks file even if she is an outcast
	$npcGoSchool['A18'] = '<a href="exec:gt ''gschool_jock_chats'', ''' + $lcase($npc_usedname['A18']) + '''"><<$npc_usedname["A18"]>></a>'
	
	if storyline = 1 and MagikDostup = 1:
		$start_type = 'sg'
		$start_type[1] = 'nomagic'
	elseif $start_type = 'csb':
		$start_type = 'sg_tg'
		$start_type[1] = 'tg'
	elseif storyline = 1:
		$start_type = 'sg_m'
	elseif MagikDostup = 1:
		$start_type = 'city'
		$start_type[1] = 'nomagic'
	else
		$start_type = 'city_tg'
		$start_type[1] = 'tg'
	end
end

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

	if pcs_skin < 150: pcs_skin = 7 * pcs_skin
	gs 'body'
	gs 'body', 'DailyUpdate'
	gs 'AppearanceSystem', 'UpdateBaseAppearnce'
	gs 'stat'
end

if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080700:
	
	!!name fix from kats to cats
	i = 1
	:loopcatsbrassave
	if kats_bras[i] = 1:
		cats_brasS[i] = kats_brasS[i]
		cats_bras[i] = kats_bras[i]
	end
	i += 1
	if i <= ARRSIZE('kats_bras'):jump 'loopcatsbrassave'
	
	killvar 'kats_brasS'
	killvar 'kats_bras'
	
	i = 1
	:loopcatspantiessave
	if kats_panties[i] = 1:
		cats_pantiesS[i] = kats_pantiesS[i]
		cats_panties[i] = kats_panties[i]
	end
	i += 1
	if i <= ARRSIZE('kats_panties'):jump 'loopcatspantiessave'
	
	killvar 'kats_pantiesS'
	killvar 'kats_panties'
	
	!!Christina variable update
	if AvelinaQW['encourage'] = 1: AvelinaQW['encourage'] = 0

	if lariskaQwestDay < 0 or lariskaQwestDay > 0: killvar 'lariskaQwestDay'
	if LariskaQW['LariskaHelp'] < 0 or LariskaQW['LariskaHelp'] > 0: LariskaQW['LariskaHelp'] = 0
	if LariskaQW['LariskaHelpEnd'] = 1: LariskaQW['LariskaHelpEnd'] = 0 

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

	if christinaQW['dompath'] >= 1:
		if christinaQW['dompath'] >= 6:
			christinaQW['fight'] = 1
			christinaQW['dompath'] = 0
		else
			christinaQW['dompath'] = 0
		end
	end
	
	if christinaQW['set_bully'] = 0:
		if (christinaQW['blackmail'] > 0 or christinaQW['pre_bm'] > 0 or christinaQW['pre_fight'] > 0 or christinaQW['fight'] > 0) and christinaQW['set_bully'] = 0:
			christinaQW['set_bully'] = 1
			christinaQW['bully'] = 40
		end
		if christinaQW['subpath'] > 0:
			christinaQW['set_bully'] = 1
			christinaQW['bully'] = 60
		end
	end

	!!Schedule migrated to the array, no need to change first
	killvar 'chrisloc'
	killvar 'lariloc'
	killvar 'anyaloc'
	killvar 'kolloc'
	killvar 'sdadloc'
	killvar 'father_go'
	killvar 'momloc'
	killvar 'momclean1'
	killvar 'momclean2'
	if mother_go > 0:
		locat['Mom_cafe_sex'] = mother_go
	end
	killvar 'm_day'
	killvar 'mother_go'
	killvar 'ocpd_room'
	
	if indorf > 0:
		locat['Fam_inGad'] = indorf
	end
	if indorf_month = month:
		locat['Fam_month_inGad'] = indorf_month
	end
	if dostupindorf > 0:
		locat['Fam_set_month_inGad'] = dostupindorf
	end
	killvar 'indorf'
	killvar 'indorf_month'
	killvar 'dostupindorf'
	if sister_indorf > 0:
		locat['Anya_Gad'] = sister_indorf
	end
	if sister_opr_indorf > 0:
		locat['Anya_check_Gad'] = sister_opr_indorf
	end
	killvar 'sister_indorf'
	killvar 'sister_opr_indorf'

	if workKafe = 1:
		workKafe = 0
		workKafe['job'] = 1
	end
	if item_moisturizer['time'] > 0:
		item_moisturizer_time = item_moisturizer['time']
		gs 'shortgs', 'remove_array_element', 'item_moisturizer', 'time'
	end
end

killvar 'hypnoHairStyle'

if mod_list > 0:
	mod_i=1
	:mod_data_updater
	if $mod_name[mod_i] ! '':
		$mod_su_name = 'mod_<<$mod_name[mod_i]>>_saveupdater'
		if LOC($mod_su_name): gs $mod_su_name
	end
	if mod_list > mod_i:
		mod_i+=1
		jump 'mod_data_updater'
	end
	killvar '$mod_su_name'
	killvar 'mod_i'
end

if stat['virgin'] > 0:
	stat['think_virgin'] = stat['virgin']
	gs 'shortgs', 'remove_array_element', 'stat', 'virgin'
end


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

end

if ((100*version_major +version_minor)*100+version_revision)*100+version_patch  < 00080800:
	!!update base appearance to the new calculation
	gs 'AppearanceSystem', 'UpdateBaseAppearnce'
	gs 'AppearanceSystem'
	if $wloc = 'default':$wloc = 'default1'

	!! new teeth variables
	if pcs_teeth >= 0: 
		pcs_missing_teeth = pcs_teeth
		pcs_teeth = 0
	end

	!! udate of Artem quest variables to an array.
	if artembj > 0: artemQW['bj'] =  artembj & killvar 'artembj'
	if artemsex > 0:  artemQW['sex']  = artemsex & killvar 'artemsex'
	if artemanal > 0: artemQW['anal'] = artemanal & killvar 'artemanal'
	if artemhj > 0:  artemQW['hj'] = artemhj & killvar 'artemhj'
	if artembrokenheart > 0: artemQW['brokenheart'] = artembrokenheart & killvar 'artembrokenheart'
	if artemStripSee > 0: artemQW['stripsee'] = artemStripSee & killvar 'artemStripSee'
	if artemlove > 0: artemQW['artemlove'] = artemlove & killvar 'artemlove'
	if artemblok > 0: artemQW['artemblok'] = artemblok & killvar 'artemblok'
	if artembf > 0:  artemQW['bf'] = artembf & killvar 'artembf'
	if artdryhump > 0: artemQW['dryhump'] = artdryhump & killvar 'artdryhump'
	if artlie > 0: artemQW['artlie'] = artlie & killvar 'artlie'
	if artfall > 0: artemQW['artfall'] = artfall & killvar 'artfall'
	if artdate > 0: artemQW['date'] =  artdate & killvar 'artdate'
	if artdim > 0:  artemQW['dimka'] = artdim & killvar 'artdim'
	if artslutlove > 0:  artemQW['slutlove'] = artslutlove & killvar 'artslutlove'
	if artsveslut > 0: artemQW['sveslut'] = artsveslut & killvar 'artsveslut'
	if metArtemMom > 0: artemQW['metArtemMom'] = metArtemMom & 'metArtemMom'
	if artdimhelp > 0: artemQW['dimkahelp'] = artdimhelp & killvar 'artdimhelp'
	
	!! update Julia to an array
	if JulMilBestFrend > 0: juliaQW['JulMilBestFrend'] = JulMilBestFrend & killvar 'JulMilBestFrend'
	if eatJulMilDay: juliaQW['eatJulMilDay'] = eatJulMilDay & killvar 'eatJulMilDay'
	if SexTalkJulia: juliaQW['SexTalkJulia'] = SexTalkJulia & killvar 'SexTalkJulia'
	if BeInJulMilHome: juliaQW['home_unlocked'] = BeInJulMilHome & killvar 'BeInJulMilHome'
	if JuliaMilLernQW: juliaQW['study_unlocked'] = JuliaMilLernQW & killvar 'JuliaMilLernQW'
		
end

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

	!!--------------------------------------------------------------------
	!! Prostitution related changes
	!!--------------------------------------------------------------------

	!! Gadukino prostitution
	gs 'prostitution_functions', 'set_gadukion_prostitute'

	!! Anuahka''s variables put in an array.

	if anushkaFirstvisit > 0: anushkaQW['first_visit'] = anushkaFirstvisit & killvar 'anushkaFirstvisit'
	if Anush_lunch > 0:  anushkaQW['lunch'] = Anush_lunch & killvar 'Anush_lunch'
	if nush_model > 0: anushka['model'] = nush_model & killvar 'nush_model'
	if foto_anush_referral > 0:  anushka['model_referral'] = foto_anush_referral & killvar 'foto_anush_referral'
	if AnushkaCompUse > 0: anushkaQW['computer_use'] = AnushkaCompUse & killvar 'AnushkaCompUse'
	if marspyknow > 0: anushkaQW['marspyknow'] = marspyknow & killvar 'marspyknow'
	if nushstrapanalpain > 0: anushkaQW['strapon_anal_pain'] = nushstrapanalpain & killvar 'nushstrapanalpain'
	if nushstrapon > 0: anushkaQW['strapon'] = nushstrapon & killvar 'nushstrapon'
	if domnush > 0: anushkaQW['dom_nush'] = domnush & killvar 'domnush'
	if seenEd > 0: anushkaQw['seen_ed'] = seenEd & killvar 'seenEd'
	if valeriaIntroduced > 0: anushkaQw['valeria_introduced'] = valeriaIntroduced & killvar 'valeriaIntroduced'
	if showerphotos > 0: anushkaQW['shower_photos'] = showerphotos & killvar 'showerphotos'
	if anushka_tv_day > 0: anushkaQW['tv_day'] =  anushka_tv_day & killvar 'anushka_tv_day'
	if anushka_shower_day > 0: anushkaQW['shower_day'] = anushka_shower_day & killvar 'anushka_shower_day'
	if AnushkaHomeDay > 0: anushkaQW['home_day'] = AnushkaHomeDay & killvar 'AnushkaHomeDay'
	if nush_photoshoot > 0: anushkaQW['photoshoot'] = nush_photoshoot & killvar 'nush_photoshoot'
	if NushVsNiko > 0: anushka['vs_niko'] =  NushVsNiko & killvar 'NushVsNiko'
	if nushaboutalyona > 0: anushkaQW['about_alyona'] = nushaboutalyona & killvar 'nushaboutalyona'
	if valspy > 0: anushkaQW['valspy'] =  valspy & killvar 'valspy'
	if radnushdate > 0: anushkaQW['rad_date'] = radnushdate & killvar 'radnushdate'
	if radspy > 0: anushkaQW['radspy'] =  radspy & killvar ' radspy'
	if nushfedor3s > 0: anushkaQW['fedor_3some'] =  nushfedor3s & killvar 'nushfedor3s'
	if Anush_sex > 0: anushkaQW['sex'] = Anush_sex & killvar 'Anush_sex'
	if Anush_dolls > 0: anushkaQW['dolls'] = Anush_dolls & killvar 'Anush_dolls'
	if anushka_toilet > 0: anushkaQW['toilet'] = anushka_toilet & killvar 'anushka_toilet'
	if marspy > 0: anushkaQW['marspy'] = marspy & killvar 'marspy'
	if bandpracticeinvite > 0: gopnikbandQW['practice_invite'] = bandpracticeinvite  & killvar 'bandpracticeinvite'

end

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

	!!--------------------------------------------------------------------
	!! Homes, Properties and Internet Update
	!!--------------------------------------------------------------------

	!! Transferring the owned, rented, accessible properties
	! city apartment
	if home_owned[1] = 1 or owned_property['city_apartment'] = 1: 
		gs 'homes_properties', 'rent_property', 'city_apartment', ArendHouseSL
	elseif home_owned[1] = 2 or owned_property['city_apartment'] = 2: 
		gs 'homes_properties', 'buy_property', 'city_apartment'
	elseif home_owned[1] = 3 or owned_property['city_apartment'] = 3: 
		gs 'homes_properties', 'tenants_move_in', 'city_apartment',sdaday, sdamonth
	end

	!! Checking for renovation
	if home_owned[1] > 0 or owned_property['city_apartment'] = 1:
		if rembedr = 1: gs 'homes_properties', 'renovate_property', 'city_apartment', 50000, 'bedroom'
		if remsitr = 1: gs 'homes_properties', 'renovate_property', 'city_apartment', 50000, 'living room'
		if remkorr = 1: gs 'homes_properties', 'renovate_property', 'city_apartment', 50000, 'hallway'
		if remvanr = 1: gs 'homes_properties', 'renovate_property', 'city_apartment', 50000, 'bathroom'
		if remkuhr = 1: gs 'homes_properties', 'renovate_property', 'city_apartment', 50000, 'kitchen'
	end
	! parents home
	if home_owned[2] > 0 or owned_property['parents_home'] > 0: gs 'homes_properties', 'give_access', 'parents_home'
	! cottage in the village
	if home_owned[3] > 0 or owned_property['village_cottage'] > 0:  gs 'homes_properties', 'buy_property', 'village_cottage'
	if home_owned[3] > 1 or owned_property['village_cottage-renovated'] = 1:  gs 'homes_properties', 'renovate_property', 'village_cottage', 200000
	! Pushking old town apartment
	if home_owned[4] = 1 or owned_property['old_town_apartment'] = 1: gs 'homes_properties', 'rent_property', 'old_town_apartment', ArendHouseSL4
	! Matryona mansion
	if home_owned[5] > 0 or owned_property['matryona_mansion'] > 0: gs 'homes_properties', 'buy_property', 'matryona_mansion'
	if home_owned[5] > 1 or owned_property['matryona_mansion-construction-status'] = 1: gs 'homes_properties', 'progress_construction_status', 'matryona_mansion'
	if home_owned[5] > 2 or owned_property['matryona_mansion-construction-status'] = 2: gs 'homes_properties', 'progress_construction_status', 'matryona_mansion'
	! Pavlovsk hotel room
	if home_owned[6] > 0 or owned_property['pavlovsk_hotel'] > 0:  gs 'homes_properties', 'give_access', 'pavlovsk_hotel'
	! Live in maid bedroom
	if home_owned[7] > 0 or owned_property['maid_bedroom'] > 0:  gs 'homes_properties', 'give_access', 'maid_bedroom'
	! Niko apartment
	if home_owned[8] > 0 or owned_property['niko_apartment'] > 0:  gs 'homes_properties', 'give_access', 'niko_apartment'
	! Shulga apartment
	if home_owned[9] > 0 or owned_property['shulga_apartment'] > 0:  gs 'homes_properties', 'give_access', 'shulga_apartment'
	! Lyceum dorm room
	if home_owned[10] > 0 or owned_property['lyceum_dorm'] > 0:  gs 'homes_properties', 'give_access', 'lyceum_dorm'
	! University dorm room
	if home_owned[11] > 0 or owned_property['university_dorm'] > 0:  gs 'homes_properties', 'give_access', 'university_dorm'
	! Hunters lodge
	if home_owned[12] > 0 or owned_property['hunters_lodge'] > 0:  gs 'homes_properties', 'give_access', 'hunters_lodge'
	! Shared apartment in Pavlovsk
	if home_owned[13] > 0 or owned_property['shared_apartment'] > 0:  gs 'homes_properties', 'give_access', 'shared_apartment'
	! Grandparents house
	if home_owned[14] > 0 or owned_property['grandparents_house'] > 0:  gs 'homes_properties', 'give_access', 'grandparents_house'
	! City residential house
	if home_owned[15] > 0 or owned_property['city_house'] > 0:  gs 'homes_properties', 'buy_property', 'city_house'
	! Meynold household
	if home_owned[16] > 0 or owned_property['meynold_household'] > 0:  gs 'homes_properties', 'give_access', 'meynold_household'

	!! Setting the current home and fixing potential missing access issues
	if curr_home > 0 and $home['current'] = '': gs 'homes_properties', 'set_home', '', STR(curr_home)
	if $home['current'] = 'parents_home' and accessible_property['parents_home'] = 0: gs 'homes_properties', 'give_access', 'parents_home'
 
	killvar 'home_owned' & killvar 'curr_home' & killvar 'ArendHouseSL' & killvar 'ArendHouseSL4'
	killvar 'home_rent_txt' & killvar 'home_value' & killvar 'home_value_txt'
	killvar 'sdaday' & killvar 'sdamonth' & killvar 'owned_property'

	if $home['current'] = '':
		if mid($start_type, 1, 2) = 'sg':
			gs 'homes_properties', 'give_access', 'parents_home'
			gs 'homes_properties', 'set_home', 'parents_home'
		elseif mid($start_type, 1, 4) = 'city':
			gs 'homes_properties', 'give_access', 'city_apartment'
			gs 'homes_properties', 'set_home', 'city_apartment'
		elseif mid($start_type, 1, 3) = 'uni':
			gs 'homes_properties', 'give_access', 'university_dorm'
			gs 'homes_properties', 'set_home', 'university_dorm'
		end
	end

	!! Setting the internet
	if internet > 0:
		old_internet_value = 10*internet
		if $home['internet_enabled'] = 1: 
			gs 'internet_mobile', 'buy_subscription', $home['current'], 900			
			if (old_internet_value - 900) >= 0: money += (old_internet_value - 900)
		else
			if old_internet_value >= 1200: 
				gs 'internet_mobile', 'buy_subscription', 'mobile', 1200
				if (old_internet_value - 1200) > 0: money += (old_internet_value - 1200)
			else
				gs 'internet_mobile', 'top_up_metered', 'metered_mobile', internet*60
			end
		end
		killvar 'internet'
	end

	!! Setting the mobile phone calls and texts
	if balans > 0:
		if (balans - 800) >= 0: 
			gs 'internet_mobile', 'buy_subscription', 'monthly_calls', 800
			money += (balans - 800)
		else
			if balans >= 225: 
				temp_phone_mult = balans/225
				temp_phone_rem = balans MOD 225
				new_balans = temp_phone_mult * 240
				gs 'internet_mobile', 'top_up_metered', 'metered_calls', new_balans
				if temp_phone_rem > 0: money += temp_phone_rem
			elseif balans >= 170:
				 temp_phone_rem = balans MOD 170
				 gs 'internet_mobile', 'top_up_metered', 'metered_calls', 180
				 if temp_phone_rem > 0: money += temp_phone_rem
			elseif balans = 115:
				 temp_phone_rem = balans MOD 115
				 gs 'internet_mobile', 'top_up_metered', 'metered_calls', 120
				 if temp_phone_rem > 0: money += temp_phone_rem
			elseif balans >= 60: 
				 temp_phone_rem = balans MOD 60
				 gs 'internet_mobile', 'top_up_metered', 'metered_calls', 60
				 if temp_phone_rem > 0: money += temp_phone_rem
			else
				gs 'internet_mobile', 'top_up_metered', 'metered_calls', balans
			end
		end	
		killvar 'balans' & killvar 'temp_phone_rem' & killvar 'temp_phone_mult' & killvar 'new_balans'
	end


	!! ------------ NPC Stat Updater ------------------------

	if $ARGS[0] = 'npc_stat_update':
		if npc_start_free_time[$boy] = 0 or npc_day_off[$boy] = 0:
			if npc_finance[$boy] = 0:
				if rand(1,3) = 1:
					npc_start_free_time[$boy] = 9
					npc_end_free_time[$boy] = 12
				elseif rand(1,2) = 1:
					npc_start_free_time[$boy] = 16
					npc_end_free_time[$boy] = 20
				else
					npc_start_free_time[$boy] = 20
					npc_end_free_time[$boy] = 23
				end
			elseif npc_finance[$boy] = 1:
				if rand(1,2) = 1:
					npc_start_free_time[$boy] = 9
					npc_end_free_time[$boy] = 12
				else
					npc_start_free_time[$boy] = 20
					npc_end_free_time[$boy] = 23
				end
			elseif npc_finance[$npclastgenerated] = 2:
				npc_apt_type[$npclastgenerated] = 5
				!!npc_apt_type[$npclastgenerated] = rand(5,6)
				!! apt_type 6 is disabled until pictures are added
				npc_occupation[$npclastgenerated] = rand(14,18)
				npc_car[$npclastgenerated] = rand(0,1)
			end
			npc_day_off = rand(1,7)
		end
	end
end

if ((100*version_major +version_minor)*100+version_revision)*100+version_patch < 00080806:
	if $wardrobeDefaultPagePref = 'savedOutfits':$wardrobeDefaultPagePref = 'default1'
end

if traits > 0 or trait > 0:
	
	pcs_traits['nerd_status'] = traits['nerd_status']
	pcs_traits['cumeater'] = trait['cumeater']
	pcs_traits['commando_lvl'] = trait['commando_lvl']
	pcs_traits['commando_exp'] = trait['commando_exp']
	pcs_traits['alko_status'] = traits['alko_status']
	pcs_traits['alko_points'] = traits['alko_points']
	pcs_traits['buttslut_lvl'] = traits['buttslut_lvl']
	pcs_traits['nerd_lernHome'] = traits['nerd_lernHome']
	pcs_traits['nerd_points'] = traits['nerd_points']
	pcs_traits['nerd_lessons'] = traits['nerd_lessons']
	
	killvar 'traits'
	killvar 'trait'
end

gs 'saveg'
--- saveupdater ---------------------------------

