From c8f317bcee089959e53e1a6e8b57cfc7f51a05a3 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Tue, 28 Feb 2023 15:06:40 -0500
Subject: [PATCH] Make PC backcompat more robust.

---
 src/002-config/fc-version.js                  |  2 +-
 .../backwardsCompatibility.js                 | 30 +++++++++----------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/002-config/fc-version.js b/src/002-config/fc-version.js
index 9b31d425185..ded5225ef57 100644
--- a/src/002-config/fc-version.js
+++ b/src/002-config/fc-version.js
@@ -2,5 +2,5 @@ App.Version = {
 	base: "0.10.7.1", // The vanilla version the mod is based off of, this should never be changed.
 	pmod: "4.0.0-alpha.23",
 	commitHash: null,
-	release: 1190, // When getting close to 2000, please remove the check located within the onLoad() function defined at line five of src/js/eventHandlers.js.
+	release: 1191, // When getting close to 2000, please remove the check located within the onLoad() function defined at line five of src/js/eventHandlers.js.
 };
diff --git a/src/data/backwardsCompatibility/backwardsCompatibility.js b/src/data/backwardsCompatibility/backwardsCompatibility.js
index ab4c9867720..4c5bf894744 100644
--- a/src/data/backwardsCompatibility/backwardsCompatibility.js
+++ b/src/data/backwardsCompatibility/backwardsCompatibility.js
@@ -2146,21 +2146,6 @@ App.Update.oldVersions = function(node) {
 		if (typeof V.PC.ballType === "undefined") {
 			V.PC.ballType = "human";
 		}
-		const quirks = {};
-		App.Data.geneticQuirks.forEach((value, q) => quirks[q] = 0);
-		if (typeof V.PC.geneticQuirks === "undefined") {
-			// initialize quirks from scratch
-			V.PC.geneticQuirks = clone(quirks);
-			if (V.PC.birthMaster > 0) {
-				V.PC.geneticQuirks.fertility = 2;
-			} else if (V.PC.career === "servant") {
-				V.PC.geneticQuirks.fertility = 1;
-			}
-		} else {
-			// add any new quirks
-			V.PC.geneticQuirks = Object.assign(clone(quirks), V.PC.geneticQuirks);
-		}
-		V.PC.geneMods = Object.assign({NCS: 0, rapidCellGrowth: 0, immortality: 0, flavoring: 0, aggressiveSperm: 0, livestock: 0, progenitor: 0}, V.PC.geneMods);
 		if (V.releaseID < 1032) {
 			if (V.PC.pregSource === -1) {
 				V.PC.pregSource = -6;
@@ -2440,6 +2425,21 @@ App.Update.oldVersions = function(node) {
 			V.PC.skill.combat = 10;
 		}
 	}
+	const quirks = {};
+	App.Data.geneticQuirks.forEach((value, q) => quirks[q] = 0);
+	if (typeof V.PC.geneticQuirks === "undefined") {
+		// initialize quirks from scratch
+		V.PC.geneticQuirks = clone(quirks);
+		if (V.PC.birthMaster > 0) {
+			V.PC.geneticQuirks.fertility = 2;
+		} else if (V.PC.career === "servant") {
+			V.PC.geneticQuirks.fertility = 1;
+		}
+	} else {
+		// add any new quirks
+		V.PC.geneticQuirks = Object.assign(clone(quirks), V.PC.geneticQuirks);
+	}
+	V.PC.geneMods = Object.assign({NCS: 0, rapidCellGrowth: 0, immortality: 0, flavoring: 0, aggressiveSperm: 0, livestock: 0, progenitor: 0}, V.PC.geneMods);
 	if (!V.PC.natural) {
 		V.PC.natural = new App.Entity.GeneticState();
 		if (V.PC.physicalAge >= 20) {
-- 
GitLab