From a91f29d947aa63cae386626425aad86766269a93 Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Thu, 30 Jun 2022 16:37:32 +0200
Subject: [PATCH] fix rule not resetting after accents are eliminated

---
 src/endWeek/saLongTermEffects.js |  1 +
 src/interaction/siRules.js       | 10 +++-------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/endWeek/saLongTermEffects.js b/src/endWeek/saLongTermEffects.js
index 6c867d0b254..df7f37781a6 100644
--- a/src/endWeek/saLongTermEffects.js
+++ b/src/endWeek/saLongTermEffects.js
@@ -2188,6 +2188,7 @@ App.SlaveAssignment.longTermEffects = function saLongTermEffects(slave) {
 				if (V.week - slave.weekAcquired > 10 + minWeeks) {
 					slave.accent -= 1;
 					r.push(`${He} does ${his} best to speak proper, unaccented ${V.language}, as encouraged by the rules. <span class="improvement">${His} accent has diminished to imperceptibility.</span>`);
+					slave.rules.speech = "restrictive";
 				}
 			}
 		}
diff --git a/src/interaction/siRules.js b/src/interaction/siRules.js
index d781013b6a3..7c09c37b2d5 100644
--- a/src/interaction/siRules.js
+++ b/src/interaction/siRules.js
@@ -240,14 +240,10 @@ App.UI.SlaveInteract.rules = function(slave, refresh) {
 				{value: "restrictive"},
 				{value: "permissive"},
 			];
-			if (slave.accent.isBetween(0, 4)) {
-				choices.push(
-					{value: "accent elimination"},
-				);
+			if (slave.accent > 0) {
+				choices.push({value: "accent elimination"});
 			} else if (slave.accent > 3) {
-				choices.push(
-					{value: "language lessons"},
-				);
+				choices.push({value: "language lessons"});
 			}
 			div.append(listChoices(choices, "speech"));
 			p.append(div);
-- 
GitLab