From 3b3e89c98faffa5a5805824587559273a85d0eda Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 28 May 2023 09:25:15 -0500 Subject: [PATCH] NPC owner null check --- src/engine/objects/Mob.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 1ba03815..6d8f75f8 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1393,7 +1393,7 @@ public class Mob extends AbstractIntelligenceAgent { NPCManager.applyRuneSetEffects(this); this.recalculateStats(); this.setHealth(this.healthMax); - if(this.building == null && ((Mob)this.npcOwner).BehaviourType.ordinal() == MobBehaviourType.GuardCaptain.ordinal()){ + if(this.building == null && this.npcOwner != null && ((Mob)this.npcOwner).BehaviourType.ordinal() == MobBehaviourType.GuardCaptain.ordinal()){ this.building = ((Mob)this.npcOwner).building; } else if(this.building != null){ this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z);