NPC owner null check

This commit is contained in:
2023-05-28 09:25:15 -05:00
parent 708d2e9fb3
commit 3b3e89c98f
+1 -1
View File
@@ -1393,7 +1393,7 @@ public class Mob extends AbstractIntelligenceAgent {
NPCManager.applyRuneSetEffects(this); NPCManager.applyRuneSetEffects(this);
this.recalculateStats(); this.recalculateStats();
this.setHealth(this.healthMax); 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; this.building = ((Mob)this.npcOwner).building;
} else if(this.building != null){ } else if(this.building != null){
this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z); this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z);