From bbf56f7d23f729bcb12899b82f760d02abf60832 Mon Sep 17 00:00:00 2001 From: Refringe Date: Tue, 7 Jan 2025 19:35:37 -0500 Subject: [PATCH] Potential Type Fixes These are possible fixes for the two type errors that are currently holding back type checking this branch. I say possible because it's not tested in game and I've only solved the issues with the current types and have no idea if the types are actually correct. Needs a review. --- project/src/generators/BotGenerator.ts | 2 +- project/src/services/BotLootCacheService.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/project/src/generators/BotGenerator.ts b/project/src/generators/BotGenerator.ts index 5be4ccf0..d9d215f0 100644 --- a/project/src/generators/BotGenerator.ts +++ b/project/src/generators/BotGenerator.ts @@ -442,7 +442,7 @@ export class BotGenerator { const chosenBodyTemplate = this.databaseService.getCustomization()[bot.Customization.Body]; // Find the body/hands mapping - const matchingBody: IWildBody = bodyGlobalDict[chosenBodyTemplate?._name]; + const matchingBody: IWildBody = bodyGlobalDict[chosenBodyTemplate?._name]?.[bot.Customization.Body]; if (matchingBody?.isNotRandom) { // Has fixed hands for this body, set them bot.Customization.Hands = matchingBody.hands; diff --git a/project/src/services/BotLootCacheService.ts b/project/src/services/BotLootCacheService.ts index dce38ed9..4fb9ebe2 100644 --- a/project/src/services/BotLootCacheService.ts +++ b/project/src/services/BotLootCacheService.ts @@ -126,7 +126,7 @@ export class BotLootCacheService { return false; }); - return this.cloner.clone(Object.fromEntries(filteredResult)); + return this.cloner.clone(Object.fromEntries(filteredResult) as Record); } return this.cloner.clone(result);