Browse Source

[Fixes] Get dressed for school fix

philormand 4 years ago
parent
commit
4e6946e8d6
2 changed files with 23 additions and 2 deletions
  1. 5 0
      locations/clothing.qsrc
  2. 18 2
      locations/wardrobe.qsrc

+ 5 - 0
locations/clothing.qsrc

@@ -808,6 +808,11 @@ if $ARGS[0] = 'wear':
 
 	dynamic '<<$ARGS[1]>>S[<<ARGS[2]>>] = 0'
 
+	if CloStyle2 = 4:
+		$schbrand = $clothingworntype
+		schtype = clothingwornnumber
+	end
+
 	PCloQuality = CloQuality
 	PCloThinness = CloThinness
 	PCloTopCut = CloTopCut

+ 18 - 2
locations/wardrobe.qsrc

@@ -424,13 +424,25 @@ if $ARGS[0] = 'sports_outfit':
 end
 
 if $ARGS[0] = 'school_outfit':
+	! check to see if player has created a school uniform outfit
 	if ARRSIZE('defclothingnumber') > 0:
 		SchoolOutfitLoop = 0
 		:FindSchoolOutfit
 		gs 'clothing_attributes', $defclothingtype[SchoolOutfitLoop], defclothingnumber[SchoolOutfitLoop]
+		! found an outfit that includes a school uniform
 		if CloStyle2 = 4:
+			tempSchtype = 0
+			! if they have worn a uniform recently we will use that rather than the one in the outfit
+			if schtype <> 0:	
+				tempSchtype = schtype
+				$tempSchbrand = $schbrand
+			end
+			! put the outfit on
 			gs 'wardrobe', 'default_entry_wear', SchoolOutfitLoop
-			if schtype = 0:	
+			!over ride the uniform with the most recent one used if there was one
+			if tempSchtype <> 0:	
+				clothingwornnumber = tempSchtype
+				$clothingworntype = $tempSchbrand
 				schtype = clothingwornnumber
 				$schbrand = $clothingworntype
 			end
@@ -440,8 +452,12 @@ if $ARGS[0] = 'school_outfit':
 		if SchoolOutfitLoop < ARRSIZE('defclothingnumber'):jump 'FindSchoolOutfit'
 		:FoundSchoolOutfit
 		killvar 'SchoolOutfitLoop'
+		killvar 'tempSchtype'
+		killvar '$tempSchbrand'
 	end
-	if schtype = 0 or schoolH[schtype] = 0:
+
+	! if no uniform found or the one selected is worn out, use the default one
+	if schtype = 0 or dyneval('RESULT = <<$schbrand>>H[<<schtype>>]') <= 0:
 		schtype = 6
 		$schbrand = 'school'
 	end