From 7d6588eac450b9496be7efbe450804b41f683ab1 Mon Sep 17 00:00:00 2001
From: pregmodfan <pregmodfan@cock.li>
Date: Wed, 27 Sep 2017 14:24:52 +0300
Subject: [PATCH] Small sanitycheck fix, and fix for the mergeRules logic. (Now
 it merge second level of rules properties correctly. Growth drugs setup for
 example)

---
 src/js/storyJS.tw            | 20 ++++++++++++++++++++
 src/pregmod/generateChild.tw |  2 +-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/js/storyJS.tw b/src/js/storyJS.tw
index c3f73be4d06..a3073e82f3a 100644
--- a/src/js/storyJS.tw
+++ b/src/js/storyJS.tw
@@ -926,8 +926,28 @@ window.mergeRules = function(rules) {
             );
 
             if (applies)
+            {
                 combinedRule[prop] = rules[i][prop];
+            
+            	/*Some properties of rules now have second level properties. We need to check it, and change ones in combinedRule. (Good example - growth drugs. Breasts, butt, etc...) */
+            	if ( "object" == typeof rules[i][prop])
+    	        {
+	            	for (var subprop in rules[i][prop])
+    	        	{
+    	           		var subapplies = (
+            	    	combinedRule[prop][subprop] === undefined           
+                			|| (rules[i][prop][subprop] !== "no default setting")
+	            		);
+
+		            	if (subapplies)
+    		            	combinedRule[prop][subprop] = rules[i][prop][subprop];
+    		        }
+
+            	}
+           	}
+
         }
+
     }
 
     return combinedRule;
diff --git a/src/pregmod/generateChild.tw b/src/pregmod/generateChild.tw
index 3000b5dc421..e459315cc85 100644
--- a/src/pregmod/generateChild.tw
+++ b/src/pregmod/generateChild.tw
@@ -563,7 +563,7 @@
 	<<set $activeSlave.underArmHStyle = either("bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "bushy", "hairless")>>
 <</if>>
 <<if $activeSlave.fetish == "mindbroken">>
-	<<set $activeSlave.fetish = "none")>>
+	<<set $activeSlave.fetish = "none">>
 <</if>>
 <<if $incubatorImprintSetting == "terror">>
 	<<set $activeSlave.origin = "Shortly after birth, she was sealed in an aging tank until she was of age. She knows only of the terror that awaits her should she not obey her master.">>
-- 
GitLab