Fix error in ConversationService when spawning a NPC using /createNPC

This commit is contained in:
Ziggy
2021-01-10 03:28:18 +01:00
parent 43edaf78bc
commit 1d031c3611
2 changed files with 9 additions and 1 deletions

View File

@@ -127,7 +127,7 @@ class Spawner(spawn: SpawnInfo, egg: SWGObject) {
val maxLevel: Int
get() = spawn.maxLevel
val conversationId: String
val conversationId: String?
get() = spawn.conversationId
val name: String

View File

@@ -140,6 +140,10 @@ public class ConversationService extends Service {
Spawner spawner = npc.getSpawner();
String conversationId = spawner.getConversationId();
if (conversationId == null) {
return;
}
List<Conversation> conversations = conversationLoader.getInitialConversations(conversationId);
Conversation conversation = reduce(conversations, starter.getOwner());
@@ -196,6 +200,10 @@ public class ConversationService extends Service {
Spawner spawner = npc.getSpawner();
String conversationId = spawner.getConversationId();
if (conversationId == null) {
return false;
}
Collection<String> spawnConversationIds = conversationLoader.getConversationIds(conversationId);
return !spawnConversationIds.isEmpty();