mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-01-15 23:05:45 -05:00
Fix error in ConversationService when spawning a NPC using /createNPC
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user