From e90dac1b9864d5d06ffa947557c3caac96db0207 Mon Sep 17 00:00:00 2001
From: Braymann <braymann00@gmail.com>
Date: Sun, 24 Jul 2022 12:17:10 -0500
Subject: [PATCH 1/3] hoodie error prevention

---
 game/base-clothing/wardrobes.twee | 63 ++++++++++++++++++-------------
 1 file changed, 37 insertions(+), 26 deletions(-)

diff --git a/game/base-clothing/wardrobes.twee b/game/base-clothing/wardrobes.twee
index 8b427a202b..53335c022d 100644
--- a/game/base-clothing/wardrobes.twee
+++ b/game/base-clothing/wardrobes.twee
@@ -574,7 +574,7 @@ Type: <label>Everyday <<radiobutton "$outfit_type" 0 checked>></label> | <label>
 
 <<widget "toggleHood">>
 	/* If hood is up, put it down and free up the head slot*/
-	<<if $worn.upper.hoodposition is "up">> 
+	<<if $worn.upper.hoodposition is "up" and $worn.head.hood is 1 and $worn.upper.outfitPrimary.head is $worn.head.name>> 
 		<<run delete $worn.upper.outfitPrimary.head>>
 		<<set $worn.upper.hoodposition to "down">>
 		<<if _args[0] is "shop" and $tryOn.ownedStored.head.name isnot $worn.head.name and !($tryOn.ownedStored.head.outfitSecondary and $tryOn.ownedStored.head.outfitSecondary[1] isnot "broken")>>
@@ -589,36 +589,47 @@ Type: <label>Everyday <<radiobutton "$outfit_type" 0 checked>></label> | <label>
 		<</if>>
 	
 	/* If hood is down, put it back up and remove anything on the head if necessary */
-	<<else>>
+	<<elseif $worn.upper.hoodposition is "down">>
 		<<if !$worn.head.cursed>> /* No cursed head items yet, but if one is made, should probably have some popup saying this was prevented */
-			<<if _args[0] is "shop">> /*If in a shop, make sure the head item is accounted for first*/
-				<<if $tryOn.tryingOn.head isnot null>>
-					<<shopbuyv2 "head" "return" null>>/*return if trying on*/
+			<<if $worn.head.outfitSecondary and $worn.head.outfitSecondary[1] isnot "broken">>
+				<<if $worn.head.hood is 1 and $worn.head.outfitSecondary[1] is $worn.upper.name and 
+				$worn.head.colour is $worn.upper.colour and $worn.head.accessory_colour is $worn.upper.accessory_colour and
+				$worn.head.colourCustom is $worn.upper.colourCustom and $worn.head.accessory_colourCustom is $worn.upper.accessory_colourCustom>>
+					<<set $worn.upper.outfitPrimary.head to clone(setup.clothes.upper[$worn.upper.index].outfitPrimary.head)>>
+					<<set $worn.upper.hoodposition to "up">>
 				<</if>>
-				<<if $tryOn.tryingOn.upper is null and $worn.head.name isnot "naked">>
-					<<generalUndress $wardrobe_location "head">>/*send back to wardrobe if already owned*/
+			<<else>>
+				<<if _args[0] is "shop">> /*If in a shop, make sure the head item is accounted for first*/
+					<<if $tryOn.tryingOn.head isnot null>>
+						<<shopbuyv2 "head" "return" null>>/*return if trying on*/
+					<</if>>
+					<<if $tryOn.tryingOn.upper is null and $worn.head.name isnot "naked">>
+						<<generalUndress $wardrobe_location "head">>/*send back to wardrobe if already owned*/
+					<</if>>
+				<<elseif $worn.head.name isnot "naked">>
+					<<generalUndress $wardrobe_location "head">>
+				<</if>>
+				<<set $worn.upper.outfitPrimary.head to clone(setup.clothes.upper[$worn.upper.index].outfitPrimary.head)>>
+				<<set $worn.upper.hoodposition to "up">>
+				/* re-create the hood using colors from the hoodie */
+				<<set $_hoodIndex to setup.clothes.head.findIndex(x => x.name === $worn.upper.outfitPrimary.head)>>
+				<<set $worn.head to clone(setup.clothes.head[$_hoodIndex])>>
+				<<set $worn.head.colour to $worn.upper.colour>>
+				<<if $worn.head.colour is "custom">>
+					<<set $worn.head.colourCustom to $worn.upper.colourCustom>>
+				<</if>>
+				<<set $worn.head.accessory_colour to $worn.upper.accessory_colour>>
+				<<if $worn.head.accessory_colour is "custom">>
+					<<set $worn.head.accessory_colourCustom to $worn.upper.accessory_colourCustom>>
+				<</if>>
+				
+				<<if _args[0] is "shop" and $tryOn.tryingOn.upper is null>>
+					<<updateOwned "upper">>
 				<</if>>
-			<<elseif $worn.head.name isnot "naked">>
-				<<generalUndress $wardrobe_location "head">>
-			<</if>>
-			<<set $worn.upper.outfitPrimary.head to clone(setup.clothes.upper[$worn.upper.index].outfitPrimary.head)>>
-			<<set $worn.upper.hoodposition to "up">>
-			/* re-create the hood using colors from the hoodie */
-			<<set $_hoodIndex to setup.clothes.head.findIndex(x => x.name === $worn.upper.outfitPrimary.head)>>
-			<<set $worn.head to clone(setup.clothes.head[$_hoodIndex])>>
-			<<set $worn.head.colour to $worn.upper.colour>>
-			<<if $worn.head.colour is "custom">>
-				<<set $worn.head.colourCustom to $worn.upper.colourCustom>>
-			<</if>>
-			<<set $worn.head.accessory_colour to $worn.upper.accessory_colour>>
-			<<if $worn.head.accessory_colour is "custom">>
-				<<set $worn.head.accessory_colourCustom to $worn.upper.accessory_colourCustom>>
-			<</if>>
-			
-			<<if _args[0] is "shop" and $tryOn.tryingOn.upper is null>>
-				<<updateOwned "upper">>
 			<</if>>
 		<</if>>
+	<<elseif $worn.upper.hoodposition is undefined and setup.clothes.upper[$worn.upper.index].hoodposition isnot undefined>>
+		<<set $worn.upper.hoodposition to "up">>
 	<</if>>
 <</widget>>
 
-- 
GitLab


From cfe46a4f707bc5db8047a559050115936c16197b Mon Sep 17 00:00:00 2001
From: Braymann <braymann00@gmail.com>
Date: Mon, 25 Jul 2022 17:31:52 -0500
Subject: [PATCH 2/3] sex shop swarm disable fix

---
 game/overworld-town/loc-adultshop/widgets.twee | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/game/overworld-town/loc-adultshop/widgets.twee b/game/overworld-town/loc-adultshop/widgets.twee
index 1feb503f9d..0db994b7f3 100644
--- a/game/overworld-town/loc-adultshop/widgets.twee
+++ b/game/overworld-town/loc-adultshop/widgets.twee
@@ -662,7 +662,7 @@
 	<</if>>
 
 	<<rngWraith 1>>
-	<<if _wraithEvent is true and $awareness gt 300>>
+	<<if _wraithEvent is true and $awareness gt 300 and $swarmdisable is "f">>
 		<<addinlineevent "wraithdildoswarm" 2>>
 			As you're stocking a shelf with dildos, the toys start shaking. A breathless voice whispers in your ear.
 			<br><br>
-- 
GitLab


From 897af677339b0928142f2d15c5fa6c39d4039fd7 Mon Sep 17 00:00:00 2001
From: Braymann <braymann00@gmail.com>
Date: Mon, 25 Jul 2022 23:14:45 -0500
Subject: [PATCH 3/3] Clothing rebuy custom colors fix

---
 game/base-clothing/widgets.twee | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/game/base-clothing/widgets.twee b/game/base-clothing/widgets.twee
index 9c0726a08e..6d624fa84d 100644
--- a/game/base-clothing/widgets.twee
+++ b/game/base-clothing/widgets.twee
@@ -605,6 +605,8 @@
 
 		<<set $_cost to Math.trunc(getClothingCost($_item, $_slot) * 1.5)>>
 		<<set _hoodDown to $_item.hoodposition is "down">>
+		<<if $_item.colourCustom isnot undefined>><<set _colourCustom to $_item.colourCustom>><</if>>
+		<<if $_item.accessory_colourCustom isnot undefined>><<set _accessory_colourCustom to $_item.accessory_colourCustom>><</if>>
 
 		<<if $_item.outfitSecondary isnot undefined and $_item.outfitSecondary[1] is "broken">>
 		<<elseif $money gte $_cost>>
-- 
GitLab