From 831dec7e55cb1fbfe36e7591b692a76422c95f3b Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 1 Aug 2023 23:16:06 +0100 Subject: [PATCH] Check for and remove dialogs with the key "undefined" --- project/src/controllers/GameController.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/project/src/controllers/GameController.ts b/project/src/controllers/GameController.ts index 84fecfd1..18be2a7f 100644 --- a/project/src/controllers/GameController.ts +++ b/project/src/controllers/GameController.ts @@ -180,6 +180,8 @@ export class GameController this.databaseServer.getTables().bots.types.usec.firstName = [pmcProfile.Info.Nickname]; } } + + this.checkForAndRemoveUndefinedDialogs(fullProfile); } if (this.seasonalEventService.isAutomaticEventDetectionEnabled()) @@ -678,6 +680,19 @@ export class GameController } } + /** + * Check for a dialog with the key 'undefined', and remove it + * @param fullProfile Profile to check for dialog in + */ + protected checkForAndRemoveUndefinedDialogs(fullProfile: IAkiProfile): void + { + const undefinedDialog = fullProfile.dialogues["undefined"]; + if (undefinedDialog) + { + delete fullProfile.dialogues["undefined"]; + } + } + /** * Blank out the "test" mail message from prapor */