From e93eaf90b17fca541f123da7adb6d2dec2cb42fd Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Sun, 6 Oct 2024 14:15:19 -0500 Subject: [PATCH] Fixed issue with loading conversation responses when there isn't another response --- .../loader/conversation/ConversationLoader.kt | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/projectswg/holocore/resources/support/data/server_info/loader/conversation/ConversationLoader.kt b/src/main/java/com/projectswg/holocore/resources/support/data/server_info/loader/conversation/ConversationLoader.kt index 2f5df686f..6e0f6d42b 100644 --- a/src/main/java/com/projectswg/holocore/resources/support/data/server_info/loader/conversation/ConversationLoader.kt +++ b/src/main/java/com/projectswg/holocore/resources/support/data/server_info/loader/conversation/ConversationLoader.kt @@ -1,11 +1,10 @@ /*********************************************************************************** * Copyright (c) 2024 /// Project SWG /// www.projectswg.com * * * - * ProjectSWG is the first NGE emulator for Star Wars Galaxies founded on * + * ProjectSWG is an emulation project for Star Wars Galaxies founded on * * July 7th, 2011 after SOE announced the official shutdown of Star Wars Galaxies. * - * Our goal is to create an emulator which will provide a server for players to * - * continue playing a game similar to the one they used to play. We are basing * - * it on the final publish of the game prior to end-game events. * + * Our goal is to create one or more emulators which will provide servers for * + * players to continue playing a game similar to the one they used to play. * * * * This file is part of Holocore. * * * @@ -126,9 +125,9 @@ class ConversationLoader : DataLoader() { val playerMessageRaw = playerResponseObj["playerMessage"] as Map? ?: continue val prosePackage = readProsePackage(playerMessageRaw) - val nextConversationId = playerResponseObj["next"] as String? + val nextConversationId = playerResponseObj["next"] as String? ?: continue - val playerResponse = PlayerResponse(prosePackage, nextConversationId!!) + val playerResponse = PlayerResponse(prosePackage, nextConversationId) playerResponses.add(playerResponse) } @@ -141,9 +140,9 @@ class ConversationLoader : DataLoader() { for (requirementObj in requirementObjs) { val type = requirementObj["type"] as String? - val args = requirementObj["args"] as Map? + val args = requirementObj["args"] as Map val requirementParser = requirementParserMap[type]!! - val requirement = requirementParser.parse(args!!) + val requirement = requirementParser.parse(args) requirements.add(requirement) } @@ -156,9 +155,9 @@ class ConversationLoader : DataLoader() { for (eventObj in eventObjs) { val type = eventObj["type"] as String? - val args = eventObj["args"] as Map? + val args = eventObj["args"] as Map val eventParser = eventParserMap[type]!! - val event = eventParser.parse(args!!) + val event = eventParser.parse(args) events.add(event) }