From c6bb3418e4ca94390055ccd08bb742bcd2cab1f0 Mon Sep 17 00:00:00 2001
From: ezsh <ezsh.junk@gmail.com>
Date: Sun, 26 May 2019 20:58:12 +0200
Subject: [PATCH] Fix PA slaves reassignment messaging

Only show the message that the salve leaves personal attention for those
who were under it.
---
 src/js/assignJS.js | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/js/assignJS.js b/src/js/assignJS.js
index 95fa17b6df0..9fbd943c18f 100644
--- a/src/js/assignJS.js
+++ b/src/js/assignJS.js
@@ -303,18 +303,19 @@ window.assignJob = function assignJob(slave, job) {
 	}
 
 	if (slave.assignmentVisible === 0 && Array.isArray(V.personalAttention)) {
-		V.personalAttention.deleteWith(s => s.ID === slave.ID);
-		if (V.personalAttention.length === 0) {
-			if (V.PC.career === "escort") {
-				V.personalAttention = "whoring";
-			} else if (V.PC.career === "servant") {
-				V.personalAttention = "upkeep";
+		if (V.personalAttention.deleteWith(s => s.ID === slave.ID).length > 0) {
+			if (V.personalAttention.length === 0) {
+				if (V.PC.career === "escort") {
+					V.personalAttention = "whoring";
+				} else if (V.PC.career === "servant") {
+					V.personalAttention = "upkeep";
+				} else {
+					V.personalAttention = "business";
+				}
+				r += `${slave.slaveName} no longer has your personal attention; you plan to focus on ${V.personalAttention}.`;
 			} else {
-				V.personalAttention = "business";
+				r += `${slave.slaveName} no longer has your personal attention.`;
 			}
-			r += `${slave.slaveName} no longer has your personal attention; you plan to focus on ${V.personalAttention}.`;
-		} else {
-			r += `${slave.slaveName} no longer has your personal attention.`;
 		}
 	}
 	V.JobIDArray = resetJobIDArray();
-- 
GitLab