diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index 87f61c9dc76184c94571a670d4901c65553f4517..b21524e992bd719351262ac3eb06a7b14dd26f73 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -2208,6 +2208,9 @@ globalThis.DefaultRules = function(slave) { * @param {FC.RA.RuleSetters} rule */ function processEyeColor(slave, rule) { + if (!hasAnyEyes(slave)) { + return; + } // calculate our goals // iris let leftIris = getLeftEyeColor(slave); @@ -2242,14 +2245,20 @@ globalThis.DefaultRules = function(slave) { rightSclera = rule.sclera; } - if ( - getLeftEyeColor(slave) !== leftIris || getRightEyeColor(slave) !== rightIris || - getLeftEyePupil(slave) !== leftPupil || getRightEyePupil(slave) !== rightPupil || - getLeftEyeSclera(slave) !== leftSclera || getRightEyeSclera(slave) !== rightSclera + const leftNeedsChange = hasLeftEye(slave) && + (getLeftEyeColor(slave) !== leftIris || getLeftEyePupil(slave) !== leftPupil || + getLeftEyeSclera(slave) !== leftSclera); + const rightNeedsChange = hasRightEye(slave) && + (getRightEyeColor(slave) !== rightIris || getRightEyePupil(slave) !== rightPupil || + getRightEyeSclera(slave) !== rightSclera); - ) { - setEyeColorFull(slave, leftIris, leftPupil, leftSclera, "left"); - setEyeColorFull(slave, rightIris, rightPupil, rightSclera, "right"); + if (leftNeedsChange || rightNeedsChange) { + if (leftNeedsChange) { + setEyeColorFull(slave, leftIris, leftPupil, leftSclera, "left"); + } + if (rightNeedsChange) { + setEyeColorFull(slave, rightIris, rightPupil, rightSclera, "right"); + } cashX(forceNeg(V.modCost), "slaveMod", slave); const lensDesc = [];