From e3fa31bbefe009a91cde56dcd7ccc629aaed8d8e Mon Sep 17 00:00:00 2001 From: chomp Date: Mon, 6 Mar 2023 12:02:21 +0000 Subject: [PATCH] Fix: workaround for old profiles with a wall at level 2 (!29) Co-authored-by: Dev Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/29 --- project/src/helpers/HideoutHelper.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/project/src/helpers/HideoutHelper.ts b/project/src/helpers/HideoutHelper.ts index f1d232ea..e9a5a1e9 100644 --- a/project/src/helpers/HideoutHelper.ts +++ b/project/src/helpers/HideoutHelper.ts @@ -938,6 +938,24 @@ export class HideoutHelper return; } + + // Workaround for old profiles that have the wall at level 2 + if (wall.level === 2) + { + this.logger.debug("Old wall level 2 found, fixing"); + if (this.hideoutImprovementIsComplete(pmcProfile.Hideout.Improvements["639199277a9178252d38c98f"])) + { + this.logger.debug("Wall level adjusted to 3"); + wall.level++; + } + else + { + this.logger.debug("Wall level adjusted to 1"); + wall.level--; + } + } + + } }