From 9a4e95320b7807be18b1156ec5ca72ccfccd6413 Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@mailbox.org> Date: Tue, 21 Feb 2023 20:15:56 +0100 Subject: [PATCH] Finish pit BC --- src/002-config/fc-version.js | 2 +- src/data/backwardsCompatibility/pitBC.js | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/002-config/fc-version.js b/src/002-config/fc-version.js index 5e322c743b7..86917d4b348 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: 1186, // When getting close to 2000, please remove the check located within the onLoad() function defined at line five of src/js/eventHandlers.js. + release: 1187, // 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/pitBC.js b/src/data/backwardsCompatibility/pitBC.js index 855ab34c018..c6303e044a4 100644 --- a/src/data/backwardsCompatibility/pitBC.js +++ b/src/data/backwardsCompatibility/pitBC.js @@ -6,7 +6,7 @@ App.Facilities.Pit.BC = function() { } if (V.pit) { - if (V.releaseID <= 1185) { // TODO + if (V.releaseID < 1186) { V.pit.name = V.pit.name || V.pitName || "the Pit"; V.pit.virginities = V.pit.virginities || V.pitVirginities || "neither"; @@ -49,6 +49,20 @@ App.Facilities.Pit.BC = function() { delete V.pit.animal; delete V.pit.bodyguardFights; delete V.pit.slaveFightingAnimal; + + if (V.pit.virginities === "neither") { + V.pit.virginities = "none"; + } + + V.pit.active = V.pit.active || false; + V.pit.fightsBase = V.pit.fightsBase || 0; + V.pit.seats = V.pit.seats || 0; + if (V.pit.minimumHealth !== true && V.pit.minimumHealth !== false) { + V.pit.minimumHealth = true; + } + if (V.pit.slavesFighting !== null && V.pit.slavesFighting.length !== 2) { + V.pit.slavesFighting = null; + } } if (V.pit && V.pit.trainingIDs) { -- GitLab