Browse Source

[changed] more secure int ARGS set

Lusticon 5 months ago
parent
commit
6482567e11
2 changed files with 3 additions and 7 deletions
  1. 2 6
      locations/boyStat.qsrc
  2. 1 1
      locations/spell.qsrc

+ 2 - 6
locations/boyStat.qsrc

@@ -9,11 +9,7 @@
 !! 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 (isnum(mid($ARGS[0],1,1)) and val(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:
-		npclastcalledn = ARGS[0]
-	else
-		npclastcalledn = val($ARGS[0])
-	end
+	npclastcalledn = iif(isnum($ARGS[0]),val($ARGS[0]),ARGS[0])
 	$npcboytemp = 'A' + npclastcalledn
 	$npcboytemp = 'A' + npclastcalledn
 else
 else
 	$npcboytemp = $ARGS[0]
 	$npcboytemp = $ARGS[0]
@@ -103,7 +99,7 @@ elseif $ARGS[1] = 'f':
 	$dick_girth6 = $bstemp[3]
 	$dick_girth6 = $bstemp[3]
 	silavag6 = bstemp[4]
 	silavag6 = bstemp[4]
 else
 else
-	boyStat_i = max(ARGS[1], val($ARGS[1]))
+	boyStat_i = iif(isnum($ARGS[1]),val($ARGS[1]),ARGS[1])
 	$boy[boyStat_i] = $npclastcalled
 	$boy[boyStat_i] = $npclastcalled
 	$boydesc[boyStat_i] = $bstemp[1]
 	$boydesc[boyStat_i] = $bstemp[1]
 	dick[boyStat_i] = bstemp[2]
 	dick[boyStat_i] = bstemp[2]

+ 1 - 1
locations/spell.qsrc

@@ -15,7 +15,7 @@
 !	 ARGS[3] = Target party member number
 !	 ARGS[3] = Target party member number
 !	 ARGS[4] = Caster party member number
 !	 ARGS[4] = Caster party member number
 
 
-SuccessValue = max(val($ARGS[1]), ARGS[1])
+SuccessValue = iif(isnum($ARGS[1]),val($ARGS[1]),ARGS[1])
 $SplTxtColGood = 'green'
 $SplTxtColGood = 'green'
 $SplTxtColBad = 'red'
 $SplTxtColBad = 'red'