Skip to content
Snippets Groups Projects
Commit 029ad808 authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'pregmod-dev' into 'pregmod-master'

mergeRules JS logic fix

See merge request pregmodfan/fc-pregmod!837
parents 6dfdd062 a24869c1
No related branches found
No related tags found
No related merge requests found
...@@ -926,8 +926,28 @@ window.mergeRules = function(rules) { ...@@ -926,8 +926,28 @@ window.mergeRules = function(rules) {
); );
if (applies) if (applies)
{
combinedRule[prop] = rules[i][prop]; 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; return combinedRule;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment