From f845c0ad8077a582216ae3b32fe984663212bdc7 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 28 Jan 2024 10:15:55 -0500 Subject: [PATCH] Better handling of null guilds. --- src/engine/objects/NPC.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 7fb509e9..da0ea3ae 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -461,6 +461,8 @@ public class NPC extends AbstractCharacter { NPC newNPC = new NPC(); + newNPC.parentZoneUUID = parent.getObjectUUID(); + newNPC.name = name; newNPC.contractUUID = contractID; @@ -469,8 +471,10 @@ public class NPC extends AbstractCharacter { else newNPC.bindLoc = Vector3fImmutable.ZERO; - newNPC.parentZoneUUID = parent.getObjectUUID(); - newNPC.guildUUID = guild.getObjectUUID(); + if (guild == null) + newNPC.guildUUID = 0; + else + newNPC.guildUUID = guild.getObjectUUID(); if (building == null) newNPC.buildingUUID = 0;