From 24e939f50d72c68946e55532bd6ab4af8eb54652 Mon Sep 17 00:00:00 2001 From: Trap Date: Wed, 7 Aug 2024 02:25:21 +0200 Subject: [PATCH] fix: override_by_profiles should be optional --- src/config.ts | 2 +- src/path-to-tarkov-controller.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.ts b/src/config.ts index 52de9881..ab8b0658 100644 --- a/src/config.ts +++ b/src/config.ts @@ -122,7 +122,7 @@ export type OverrideByProfiles = ByProfileId<{ export type Config = { enabled: boolean; debug?: boolean; - override_by_profiles: OverrideByProfiles; + override_by_profiles?: OverrideByProfiles; bypass_keep_found_in_raid_tweak?: boolean; initial_offraid_position: string; reset_offraid_position_on_player_die: boolean; diff --git a/src/path-to-tarkov-controller.ts b/src/path-to-tarkov-controller.ts index e0257018..6a67d349 100644 --- a/src/path-to-tarkov-controller.ts +++ b/src/path-to-tarkov-controller.ts @@ -512,7 +512,7 @@ export class PathToTarkovController { const profile: Profile = this.saveServer.getProfile(sessionId); const profileTemplateId = profile.info.edition; - const overrideByProfiles = this.config.override_by_profiles[profileTemplateId] ?? {}; + const overrideByProfiles = this.config.override_by_profiles?.[profileTemplateId] ?? {}; return overrideByProfiles.initial_offraid_position ?? this.config.initial_offraid_position; };