NPCs are not spawned server side; change logic to handle it

This commit is contained in:
KingRainbow44 2023-05-11 21:17:08 -04:00
parent db1cc788b4
commit 6516e4be1e
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -28,18 +28,18 @@ public final class TalkManager extends BasePlayerManager {
var player = this.getPlayer(); var player = this.getPlayer();
// Check if the NPC id is valid. // Check if the NPC id is valid.
var entity = player.getScene().getEntityById(npcEntityId); var entity = player.getScene().getEntityById(npcEntityId);
if (entity == null) return; if (entity != null) {
// The config ID of the entity is the NPC's ID.
// The config ID of the entity is the NPC's ID. if (!talkData.getNpcId().contains(entity.getConfigId()))
if (!talkData.getNpcId().contains(entity.getConfigId())) return;
return; }
// Execute the talk action on associated handlers. // Execute the talk action on associated handlers.
talkData talkData
.getFinishExec() .getFinishExec()
.forEach( .forEach(
e -> e ->
this.getPlayer().getServer().getTalkSystem().triggerExec(getPlayer(), talkData, e)); player.getServer().getTalkSystem().triggerExec(player, talkData, e));
// Invoke the talking events for quests. // Invoke the talking events for quests.
var questManager = player.getQuestManager(); var questManager = player.getQuestManager();