From bea82d80f2f7844642347e78cd510d5035f1e48b Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 26 Jun 2023 18:35:51 -0400 Subject: [PATCH] Logging of invalid contracts --- src/engine/objects/NPC.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 299b27f4..2d02bdd1 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -187,7 +187,12 @@ public class NPC extends AbstractCharacter { // Default to contract load ID if (loadID == 0) - loadID = this.contract.getMobbaseID(); + if (this.contract != null) + loadID = this.contract.getMobbaseID(); + else { + Logger.error("Invalid contract for NPC: " + this.getObjectUUID()); + loadID = 2100; // Default human male + } this.mobBase = MobBase.getMobBase(this.loadID); this.level = rs.getByte("npc_level");