From 6516e4be1e1a7639c2e8681836ca640c4eb769ac Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Thu, 11 May 2023 21:17:08 -0400 Subject: [PATCH] NPCs are not spawned server side; change logic to handle it --- .../java/emu/grasscutter/game/talk/TalkManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/emu/grasscutter/game/talk/TalkManager.java b/src/main/java/emu/grasscutter/game/talk/TalkManager.java index 8a613834c..55c464ebe 100644 --- a/src/main/java/emu/grasscutter/game/talk/TalkManager.java +++ b/src/main/java/emu/grasscutter/game/talk/TalkManager.java @@ -28,18 +28,18 @@ public final class TalkManager extends BasePlayerManager { var player = this.getPlayer(); // Check if the NPC id is valid. var entity = player.getScene().getEntityById(npcEntityId); - if (entity == null) return; - - // The config ID of the entity is the NPC's ID. - if (!talkData.getNpcId().contains(entity.getConfigId())) - return; + if (entity != null) { + // The config ID of the entity is the NPC's ID. + if (!talkData.getNpcId().contains(entity.getConfigId())) + return; + } // Execute the talk action on associated handlers. talkData .getFinishExec() .forEach( e -> - this.getPlayer().getServer().getTalkSystem().triggerExec(getPlayer(), talkData, e)); + player.getServer().getTalkSystem().triggerExec(player, talkData, e)); // Invoke the talking events for quests. var questManager = player.getQuestManager();