From 3775fb336b44073f1b2be9c9bffdde33b909d393 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 15 Jan 2024 06:44:33 -0500 Subject: [PATCH] Null check was done previously. --- src/engine/objects/NPC.java | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index bfb64654..ac010ce1 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -842,7 +842,6 @@ public class NPC extends AbstractCharacter { else this.guild = Guild.getGuild(this.guildUUID); - if (this.guild == null) this.guild = Guild.getErrantGuild(); @@ -872,27 +871,23 @@ public class NPC extends AbstractCharacter { if (this.building != null) NPCManager.slotCharacterInBuilding(this); - if (this.contract != null) { - this.symbol = this.contract.getIconID(); - this.modTypeTable = this.contract.getNPCModTypeTable(); - this.modSuffixTable = this.contract.getNpcModSuffixTable(); - this.itemModTable = this.contract.getItemModTable(); - int VID = this.contract.getVendorID(); - - if (VID != 0) - this.vendorID = VID; - else - this.vendorID = 1; //no vendor items - } + this.symbol = this.contract.getIconID(); + this.modTypeTable = this.contract.getNPCModTypeTable(); + this.modSuffixTable = this.contract.getNpcModSuffixTable(); + this.itemModTable = this.contract.getItemModTable(); + int VID = this.contract.getVendorID(); - if (this.mobBase != null) { - this.healthMax = this.mobBase.getHealthMax(); - this.manaMax = 0; - this.staminaMax = 0; - this.setHealth(this.healthMax); - this.mana.set(this.manaMax); - this.stamina.set(this.staminaMax); - } + if (VID != 0) + this.vendorID = VID; + else + this.vendorID = 1; //no vendor items + + this.healthMax = this.mobBase.getHealthMax(); + this.manaMax = 0; + this.staminaMax = 0; + this.setHealth(this.healthMax); + this.mana.set(this.manaMax); + this.stamina.set(this.staminaMax); if (this.parentZone.guild_zone) if (NPC.GetNPCProfits(this) == null)