diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index b9222302..b9ce59f0 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -190,17 +190,9 @@ public class NPC extends AbstractCharacter { this.mobBase = MobBase.getMobBase(this.loadID); this.level = rs.getByte("npc_level"); this.isMob = false; - int buildingID = rs.getInt("npc_buildingID"); - - try{ - this.building = BuildingManager.getBuilding(buildingID); - - }catch(Exception e){ - this.building = null; - Logger.error( e.getMessage()); - } - this.name = rs.getString("npc_name"); + int buildingID = rs.getInt("npc_buildingID"); + this.building = BuildingManager.getBuilding(buildingID); // Most objects from the cache have a default buy // percentage of 100% which was a dupe source due @@ -247,11 +239,16 @@ public class NPC extends AbstractCharacter { if (this.upgradeDateTime != null) submitUpgradeJob(); - if (this.contract != null) + this.name = rs.getString("npc_name"); + + // Zone cache can override contract name + + if (this.nameOverride.isEmpty()) this.nameOverride = rs.getString("npc_name") + " the " + this.getContract().getName(); else this.nameOverride = rs.getString("npc_name"); + }catch(Exception e){ Logger.error(e); e.printStackTrace();