Browse Source

[fixed] Potential issue from workKafe variable being used alone and as base for array as spotted by rachels

Kevin_Smarts 2 years ago
parent
commit
9b11d7c951

+ 1 - 1
locations/MartinTalk.qsrc

@@ -639,7 +639,7 @@ if $ARGS[0] = '':
 			end
 		end
 		
-		if workKafe = 1: 
+		if workKafe['job'] = 1: 
 			act '"I work as a waitress"':
 				cla
 				'"I am a waitress in a cafe."'

+ 2 - 2
locations/cikl.qsrc

@@ -764,7 +764,7 @@ if day = 25:
 		'<b><font color="green">Your salary of <<pay>> <b>₽</b> has been paid into your bank account for your job as a secretary.</font></b>'
 	end
 
-	if workKafe = 1 and paydayKafe = 0:
+	if workKafe['job'] = 1 and paydayKafe = 0:
 		paydayKafe = 1
 		pay = smenaKafe * 600
 		karta += pay
@@ -879,7 +879,7 @@ end
 
 if day ! 25:
 	if paydayHusb = 1:paydayHusb = 0
-	if workKafe = 1 and paydayKafe = 1:paydayKafe = 0
+	if workKafe['job'] = 1 and paydayKafe = 1:paydayKafe = 0
 	if workSec = 1 and paydaySec = 1:paydaySec = 0
 	if (home_owned[1] = 1 or home_owned[4] > 0) and haday = 1:haday = 0
 	if (home_owned[1] > 0 or home_owned[4] > 0 or home_owned[5] = 2) and electroday = 1:electroday = 0

+ 8 - 8
locations/city_kafe.qsrc

@@ -66,7 +66,7 @@ if $ARGS[0] = 'vlad':
 	if npc_rel['A41'] = 0:'At the end of the bar sits a short, but very broad caucasian, he''s writing something.'
 	if npc_rel['A41'] > 0:'At the end of the bar sits the owner of the diner, Givi K. He''s writing something.'
 
-	if workKafe = 0:
+	if workKafe['job'] = 0:
 		if GiviSex >= 2 and Givisexday < 1 and Venera < 4:
 			act 'Have some fun with Givi':
 				*clr & cla
@@ -144,7 +144,7 @@ if $ARGS[0] = 'vlad':
 		act 'Resign':
 			cla
 			work = 0
-			workKafe = 0
+			workKafe['job'] = 0
 			pay = smenaKafe * 600
 			money += pay
 			smenaKafe = 0
@@ -154,16 +154,16 @@ if $ARGS[0] = 'vlad':
 		end
 	end
 
-	if workKafe > 0 and week > 1 and week < 5:'Hi, <<$pcs_nickname>>. Skipping work?'
-	if workKafe > 0 and week > 4:'Well, hello <<$pcs_nickname>>!'
-	if npc_rel['A41'] = 1 and workKafe < 1:'He looks up waiting for you to speak.'
+	if workKafe['job'] > 0 and week > 1 and week < 5:'Hi, <<$pcs_nickname>>. Skipping work?'
+	if workKafe['job'] > 0 and week > 4:'Well, hello <<$pcs_nickname>>!'
+	if npc_rel['A41'] = 1 and workKafe['job'] < 1:'He looks up waiting for you to speak.'
 
 	if npc_rel['A41'] = 0:
 		npc_rel['A41'] = 1
 		'Hello! I''m Givi Karapetovich, owner of the diner. What do you want?'
 	end
 
-	if (work = 0 and workKafe = 0 and cheatWork = 0) or (workKafe = 0 and cheatWork = 1):
+	if (work = 0 and workKafe['job'] = 0 and cheatWork = 0) or (workKafe['job'] = 0 and cheatWork = 1):
 		act 'Apply for a job at the diner':
 			cla
 			'You ask Givi if he has any job openings at the diner.'
@@ -182,7 +182,7 @@ if $ARGS[0] = 'vlad':
 					cla
 					*nl
 					work = 1
-					workKafe = 1
+					workKafe['job'] = 1
 					smenaKafe = 0
 					'You hand over your work book, and with a smile Givi takes it. "Don''t forget: work is every Tuesday, Wednesday and Thursday, and you need to be here between 11 and 12."'
 
@@ -222,7 +222,7 @@ if $ARGS[0] = 'work':
 	act 'Resign':
 		cla
 		work = 0
-		workKafe = 0
+		workKafe['job'] = 0
 		workKafe['at_work'] = 0
 		pay = smenaKafe * 600
 		money += pay

+ 1 - 1
locations/city_residential.qsrc

@@ -136,7 +136,7 @@ if hour >= 8 and hour <= 15 and week < 6:
 else	
 	'Near the market is a tailor shop where you can get your clothes resized if needed. '+iif(week < 6, 'It closes at 16:00.', 'It''s closed on weekends.')
 end
-if hour >= 11 and hour < 12 and week > 1 and week < 5 and workKafe = 1:
+if hour >= 11 and hour < 12 and week > 1 and week < 5 and workKafe['job'] = 1:
 	'The side door of <a href="exec: minut += 1 & gt ''city_kafe'', ''work''">"The Roadhouse"</a> is open, allowing employees to enter to begin their shift.'
 elseif hour >= 12 and hour <= 22 and week ! 1:
 	'In a side alley, next to the uniquely styled diner <a href="exec: minut += 1 & gt ''city_kafe'', ''start''">"The Roadhouse"</a>, you can hear some <a href="exec: minut += 1 & gt ''gopnew'', ''start''">gopniks</a> swearing and laughing.'

+ 1 - 1
locations/journal.qsrc

@@ -70,7 +70,7 @@ if $ARGS[0] = 'records':
 	'<center><h2>Work</h2></center>'
 	*nl
 	if workPTU > 2:'You work as a teacher at the Lycée and your schedule is Monday to Saturday, teaching between 14:00 and 16:00. Your salary is 300 <b>₽</b> per day.'
-	if (work = 1 or cheatWork = 1) and workKafe > 0:'You are working as a waitress at The Roadhouse cafe. You need to come to work between 11:00-12:00 while your working days are: Tuesday, Wednesday, and Thursday. At work, you can receive tips from customers and your wages are received on 25th of each month.'
+	if (work = 1 or cheatWork = 1) and workKafe['job'] > 0:'You are working as a waitress at The Roadhouse cafe. You need to come to work between 11:00-12:00 while your working days are: Tuesday, Wednesday, and Thursday. At work, you can receive tips from customers and your wages are received on 25th of each month.'
 	if (work = 1 or cheatWork = 1) and workhosp > 0:'You work as a nurse in the city residential area clinic. You need to come to work between 08:00-09:00 during the week. Salary is automatically transferred on the 25th of each month.'
 	if (work = 1 or cheatWork = 1) and worksalon > 0:'You work as a masseuse in the city at the Beauty Bar. You need to come to work between 09:00-10:00 while your working days are: Monday, Wednesday, and Friday. Salary is automatically transferred on 25th of each month.'
 	if (work = 1 or cheatWork = 1) and workSec > 0:'You work as a secretary at Titran Express. You need to come to work by 09:00 during the week Monday-Friday. Salary is automatically transferred on the 25th of each month.'

+ 1 - 1
locations/korr.qsrc

@@ -173,7 +173,7 @@ if BurgerQW['IlyQW']  = 3 and hour >= 9 and hour <= 20:
 			nark = 0
 			SLomka = 0
 			work = 0
-			workKafe = 0
+			workKafe['job'] = 0
 			workhosp =0
 			worksalon =0
 			tanwork =0

+ 1 - 1
locations/korr2x.qsrc

@@ -149,7 +149,7 @@ if BurgerQW['IlyQW']  = 3 and hour >= 9 and hour <= 20:
 			nark = 0
 			SLomka = 0
 			work = 0
-			workKafe = 0
+			workKafe['job'] = 0
 			workhosp = 0
 			worksalon = 0
 			tanwork = 0

+ 2 - 2
locations/love.qsrc

@@ -29,10 +29,10 @@ if $ARGS[0] = 'mother':
 	'<<$loverdesc[lover_number]>> drives you to the home of his parents. You get out and take the elevator. The door opens after only knocking once. It seems clear that they were waiting for you. You enter the apartment and are greeted by an elderly gray-haired woman dressed in trousers and a shirt. You are told to switch into a pair of slippers and are then led down a hallway into another room where the elderly woman invites you to sit down at a table.'
 	'<<$loverdesc[lover_number]>> pulls out a chair for you and you sit down. His mother places herself in front of the two of you. She looks at you with disgust in her eyes, looking like an overgrown insect, clearly thinking you are not a girl for her son. "So, darling, what do you do for a living?"'
 
-	if (work = 1 or cheatWork = 1) and workKafe = 1:'"I am a waitress in a cafe."'
+	if (work = 1 or cheatWork = 1) and workKafe['job'] = 1:'"I am a waitress in a cafe."'
 	if func('uniutil', 'student', 'enrolled'):'"I study at the university."'
 	if university['diploma'] > 0:'"I graduated from university."'
-	if work = 0 and cheatWork = 0 and workKafe ! 1:'"I''m unemployed."'
+	if work = 0 and cheatWork = 0 and workKafe['job'] ! 1:'"I''m unemployed."'
 
 	if modelfoto_nude > 30:
 		loverrelation[lover_number] = 0

+ 1 - 1
locations/qwmeet.qsrc

@@ -32,7 +32,7 @@ if $ARGS[0] = '':
 					$qwvladwork = 'I work in the market.'
 				elseif young_shop_work = 1:
 					$qwvladwork = 'I work in a store.'
-				elseif workKafe > 0:
+				elseif workKafe['job'] > 0:
 					$qwvladwork = 'I work as a waitress in a cafe.'
 				else
 					$qwvladwork = 'By and large, nothing.'

+ 4 - 0
locations/saveupdater.qsrc

@@ -1165,6 +1165,10 @@ if ((100*version_major +version_minor)*100+version_revision)*100+version_patch
 			christinaQW['bully'] = 60
 		end
 	end
+	if workKafe = 1:
+		workKafe = 0
+		workKafe['job'] = 1
+	end
 end
 
 

+ 2 - 2
locations/stat_display.qsrc

@@ -2143,8 +2143,8 @@ if enable_extra_msg = 1:
 	end
 	
 	
-!! Work at city cafe, workKafe is having the job and at_work is set when she is at work
-	if hour < 22 and week >= 2 and week <= 4 and workKafe = 1 and workKafe['at_work'] = 0:
+!! Work at city cafe, workKafe['job'] is having the job and at_work is set when she is at work
+	if hour < 22 and week >= 2 and week <= 4 and workKafe['job'] = 1 and workKafe['at_work'] = 0:
 		if hour >= 12: $stat_msg += '<BR><b><font color="red">You missed your shift at The Roadhouse cafe today.</font></b>'
 		if hour < 12: $stat_msg += '<BR><b><font color="red">Today you have a shift at The Roadhouse cafe starting at 11:00.</font></b>'
 	end

+ 3 - 3
locations/telefon.qsrc

@@ -528,7 +528,7 @@ if $ARGS[0] = 'NPCCallsForDate':
 		cla
 		'"Pretty good, you?"'
 		'<<$Call4Date["CallerName"]>>, "Great, but I kind of miss you, can we meet today?"'
-		if week > 1 and week < 5 and workKafe = 1:
+		if week > 1 and week < 5 and workKafe['job'] = 1:
 			act 'Sorry, I''m working today':
 				cla
 				'"Sorry, I''m working today."'
@@ -1077,7 +1077,7 @@ if $ARGS[0] = 'lover' and loverGender[ARGS[1]] = 0:
 
 				act 'Hang up.':gt 'telefon', 'fin'
 			end
-		elseif week > 1 and week < 5 and workKafe = 1:
+		elseif week > 1 and week < 5 and workKafe['job'] = 1:
 			act 'Sorry, I''m working today':
 				cla
 				'"Sorry, I''m working today."'
@@ -1266,7 +1266,7 @@ if $ARGS[0] = 'Phone_notebook':
 		if worksalon = 1 and (w1 = 1 or w1 = 3 or w1 = 5):$calendarday += $list + 'Working as a masseuse. <i>(9:00 - 17:00)</i>'
 !!		if maidqw > 0:$calendarday += '<br>&emsp;<b>•</b> Working as maid. <i>(16:00 - 19:00)</i>'
 		if pfilmday[i] > 0:$calendarday += $list + 'Porn shoot: <i><<$porndesc[pfilmday[i]]>></i>'
-		if d1 = 25 and (BurgerQW['Secretary'] = 1 or workKafe = 1 or workhosp = 1 or worksalon = 1 or tanwork = 1 or workSec = 1 or workFabrika = 1):$calendarday += $list + '<i>Pay day!</i>'
+		if d1 = 25 and (BurgerQW['Secretary'] = 1 or workKafe['job'] = 1 or workhosp = 1 or worksalon = 1 or tanwork = 1 or workSec = 1 or workFabrika = 1):$calendarday += $list + '<i>Pay day!</i>'
 		if d1 = nyp_day and m1 = 12 and SchoolAtestat = 0 and mid($start_type,1,2) = 'sg':$calendarday += $list + 'New Year''s party at 14:00!'
 		if (npc_QW['A33']-2) mod 2 = 1 and sisboyday+1 = daynum:
 			if sisboytrioQW = 1: