Browse Source

[fixed] string vs integer

Lusticon 5 months ago
parent
commit
103af7f26a

+ 2 - 2
locations/boyStat.qsrc

@@ -8,7 +8,7 @@
 !! A second argument calls for multiple partners. They are output as stats1, stats2, stats3, and stats4, for a total of 5 stats.
 !! A second argument calls for multiple partners. They are output as stats1, stats2, stats3, and stats4, for a total of 5 stats.
 !! If ARGS[1] is not set it defaults to zero, so you can use the variables it sets with or without [0] e.g. dick or dick[0] are equivalent 
 !! If ARGS[1] is not set it defaults to zero, so you can use the variables it sets with or without [0] e.g. dick or dick[0] are equivalent 
 
 
-if ($ARGS[0] = '' and ARGS[0] > 0) or mid($ARGS[0],1,1) < 10:
+if ($ARGS[0] = '' and ARGS[0] > 0) or (isnum(mid($ARGS[0],1,1)) and val(mid($ARGS[0],1,1)) < 10):
 	if ARGS[0] > 0:
 	if ARGS[0] > 0:
 		npclastcalledn = ARGS[0]
 		npclastcalledn = ARGS[0]
 	else
 	else
@@ -18,7 +18,7 @@ if ($ARGS[0] = '' and ARGS[0] > 0) or mid($ARGS[0],1,1) < 10:
 else
 else
 	$npcboytemp = $ARGS[0]
 	$npcboytemp = $ARGS[0]
 	!! {This error is for where something outside the range of possibility is specified. The calling code is broken. The exact thing specified will be announced.}
 	!! {This error is for where something outside the range of possibility is specified. The calling code is broken. The exact thing specified will be announced.}
-	if mid($npcboytemp,2,1) > 10:
+	if isnum(mid($npcboytemp,2,1)) and val(mid($npcboytemp,2,1)) > 10:
 		MSG 'There has been an error in the $boy passing code. Please contact a developer with what you were doing prior to receiving this message so the error may be fixed. Error type: Improper value for boyStat. Calling <<$ARGS[0]>>'
 		MSG 'There has been an error in the $boy passing code. Please contact a developer with what you were doing prior to receiving this message so the error may be fixed. Error type: Improper value for boyStat. Calling <<$ARGS[0]>>'
 		$npcboytemp = 'D0'
 		$npcboytemp = 'D0'
 	end
 	end

+ 2 - 2
locations/courtletter.qsrc

@@ -160,7 +160,7 @@ if $ARGS[0] = 'letter':
 
 
 		$policeQW_courthearing_subjects[] = mid($policeQW_courtletter_subjects[0], 14)
 		$policeQW_courthearing_subjects[] = mid($policeQW_courtletter_subjects[0], 14)
 
 
-		if $policeQW['courtletter_hearing_counter'] < 10:
+		if policeQW['courtletter_hearing_counter'] < 10:
 			policeQW['courtletter_hearing_counter'] += 1
 			policeQW['courtletter_hearing_counter'] += 1
 			pcs_mood -= 100
 			pcs_mood -= 100
 			gs 'stat'
 			gs 'stat'
@@ -197,7 +197,7 @@ if $ARGS[0] = 'letter':
 
 
 		$policeQW_courthearing_subjects[] = $policeQW_courtletter_subjects[0]
 		$policeQW_courthearing_subjects[] = $policeQW_courtletter_subjects[0]
 
 
-		if $policeQW['courtletter_hearing_counter'] < 10:
+		if policeQW['courtletter_hearing_counter'] < 10:
 			policeQW['courtletter_hearing_counter'] += 1
 			policeQW['courtletter_hearing_counter'] += 1
 			pcs_mood -= 100
 			pcs_mood -= 100
 			gs 'stat'
 			gs 'stat'

+ 1 - 1
locations/cum_call.qsrc

@@ -34,7 +34,7 @@ if $ARGS[0] ! 'precum':
 	if $boy ! $ARGS[1] and $ARGS[1] ! '': $boy = $ARGS[1]
 	if $boy ! $ARGS[1] and $ARGS[1] ! '': $boy = $ARGS[1]
 
 
 	!!This check if the name passed is not in the new MGX format
 	!!This check if the name passed is not in the new MGX format
-	if $ARGS[1] = '' or mid($ARGS[1],2,1) > 10:
+	if $ARGS[1] = '' or (isnum(mid($ARGS[1],2,1)) and val(mid($ARGS[1],2,1) > 10)):
 		if ARGS[2] = 0 or ARGS[2] = 2:
 		if ARGS[2] = 0 or ARGS[2] = 2:
 			gs 'npcgeneratec', 0, $ARGS[1], rand(18,60)
 			gs 'npcgeneratec', 0, $ARGS[1], rand(18,60)
 			gs 'boyStat', $npclastgenerated
 			gs 'boyStat', $npclastgenerated

+ 1 - 1
locations/npcgenext.qsrc

@@ -119,7 +119,7 @@ end
 ! {Venerial Disease Generator. requires an index.}
 ! {Venerial Disease Generator. requires an index.}
 if $args[0] = 'rstd':
 if $args[0] = 'rstd':
 	if $ARGS[1] = '': ARGS[1] = 0
 	if $ARGS[1] = '': ARGS[1] = 0
-	if mid($ARGS[1],1,1) < 10: 
+	if isnum(mid($ARGS[1],1,1)) and val(mid($ARGS[1],1,1)) < 10: 
 		$tempvan1 = 'A' + $ARGS[1]
 		$tempvan1 = 'A' + $ARGS[1]
 	else
 	else
 		$tempvan1 = $ARGS[1]
 		$tempvan1 = $ARGS[1]

+ 2 - 2
locations/pet_dog.qsrc

@@ -96,7 +96,7 @@ if $ARGS[0] = 'feed':
 	if $home['current'] ! 'parents_home': objects['dog_food'] -= 1
 	if $home['current'] ! 'parents_home': objects['dog_food'] -= 1
 	gs 'stat'
 	gs 'stat'
 	'<center><img <<$set_imgh>> src="images/characters/shared/rex/feeding_'+rand(0,1)+'.jpg"></center>'
 	'<center><img <<$set_imgh>> src="images/characters/shared/rex/feeding_'+rand(0,1)+'.jpg"></center>'
-	'"Come '+iif(rand(0,1) = 0, 'boy', '<<$rex[''name'']>>')+' let''s get you something to eat," you say and go into the kitchen. He '+iif(rand(0,1) = 0, 'follows and watches you fill his bowl with big thankful eyes', 'runs into the kitchen the second he hears you filling his bowl')+' before he eagerly digs in.'
+	'"Come '+iif(rand(0,1) = 0, 'boy', $rex['name'])+' let''s get you something to eat," you say and go into the kitchen. He '+iif(rand(0,1) = 0, 'follows and watches you fill his bowl with big thankful eyes', 'runs into the kitchen the second he hears you filling his bowl')+' before he eagerly digs in.'
 	*nl
 	*nl
 	if $home['current'] ! 'parents_home': 'You have enough dog food for <<objects[''dog_food'']>> meals.'
 	if $home['current'] ! 'parents_home': 'You have enough dog food for <<objects[''dog_food'']>> meals.'
 
 
@@ -158,7 +158,7 @@ if $ARGS[0] = 'exercise':
 		gs 'sweat', 'add', 20
 		gs 'sweat', 'add', 20
 		gs 'exercise', 'tier1', 60, 'run'
 		gs 'exercise', 'tier1', 60, 'run'
 		fat -= rand(1,3)
 		fat -= rand(1,3)
-		'<center><img <<$set_imgh>> src="images/characters/shared/rex/run_'+iif(daystage = 1 or daystage = 3 or daystage = 4 or daystage = 6, 'sunset', rand(0,1))+'.jpg"></center>'
+		'<center><img <<$set_imgh>> src="images/characters/shared/rex/run_'+iif(daystage = 1 or daystage = 3 or daystage = 4 or daystage = 6, 'sunset', str(rand(0,1)))+'.jpg"></center>'
 		'<<$rex[''name'']>> excitedly runs around you as you put on your running shoes. He loves going on runs with you. "Yes," you say with a smile. "We''re going for a run. Are you ready?" He wags his tail. "Alright, let''s go boy!"'
 		'<<$rex[''name'']>> excitedly runs around you as you put on your running shoes. He loves going on runs with you. "Yes," you say with a smile. "We''re going for a run. Are you ready?" He wags his tail. "Alright, let''s go boy!"'
 		'You head out and start your run. <<$rex[''name'']>> follows obediently, sometimes stopping to sniff or mark his territory, but he always returns to your side before you get too far away.'
 		'You head out and start your run. <<$rex[''name'']>> follows obediently, sometimes stopping to sniff or mark his territory, but he always returns to your side before you get too far away.'
 		'You return home an hour later, exhausted and sweaty.'
 		'You return home an hour later, exhausted and sweaty.'

+ 2 - 2
locations/saveupdater.qsrc

@@ -1059,10 +1059,10 @@ if temp_current_save_version  < 00080307:
 
 
 	!!Moved Igor''s quest to use daystart.
 	!!Moved Igor''s quest to use daystart.
 	if igor_DimaNos = 2 or igor_DimaNos = 3:
 	if igor_DimaNos = 2 or igor_DimaNos = 3:
-		if $igor_DimaNos_day > 5:
+		if max(val($igor_DimaNos_day), igor_DimaNos_day) > 5:
 			igor_DimaNos_day = daystart
 			igor_DimaNos_day = daystart
 		else
 		else
-			igor_DimaNos_day = daystart + 6 - $igor_DimaNos_day
+			igor_DimaNos_day = daystart + 6 - max(val($igor_DimaNos_day), igor_DimaNos_day)
 		end
 		end
 	end
 	end
 end
 end

+ 3 - 3
locations/transport_functions.qsrc

@@ -71,7 +71,7 @@ if $ARGS[0] = 'set_train_ticket':
 	temp_price = func('transport_functions', 'get_train_price', $ARGS[1], $ARGS[2])
 	temp_price = func('transport_functions', 'get_train_price', $ARGS[1], $ARGS[2])
 	$temp_time = func('transport_functions', 'display_train_timecost', $ARGS[1], $ARGS[2])
 	$temp_time = func('transport_functions', 'display_train_timecost', $ARGS[1], $ARGS[2])
 
 
-	if mid($temp_time, 1, 1) < 2:
+	if isnum(mid($temp_time, 1, 1)) and val(mid($temp_time, 1, 1)) < 2:
 		if money < ARGS[1]:
 		if money < ARGS[1]:
 			dynamic 'act ''Buy a ticket to <<$ARGS[3]>> (<font color="red"><<$temp_time>> - <<temp_price>> <b>₽</b></font>)'': ''<br><font color="red">You don''t have enough money for a ticket to <<$ARGS[3]>>'' '
 			dynamic 'act ''Buy a ticket to <<$ARGS[3]>> (<font color="red"><<$temp_time>> - <<temp_price>> <b>₽</b></font>)'': ''<br><font color="red">You don''t have enough money for a ticket to <<$ARGS[3]>>'' '
 		else
 		else
@@ -334,7 +334,7 @@ if $ARGS[0] = 'display_train_schedule':
 	end
 	end
 	$train_schedule += '</table></center>'
 	$train_schedule += '</table></center>'
 
 
-	'<<$train_schedule>>'
+	$train_schedule
 
 
 	killvar 'train_schedule'
 	killvar 'train_schedule'
 	killvar 'th'
 	killvar 'th'
@@ -838,7 +838,7 @@ if $ARGS[0] = 'display_bus_schedule':
 	end
 	end
 	$bus_schedule += '</table></center>'
 	$bus_schedule += '</table></center>'
 
 
-	'<<$bus_schedule>>'
+	$bus_schedule
 
 
 	killvar 'bus_schedule'
 	killvar 'bus_schedule'
 	killvar 'th'
 	killvar 'th'