Browse Source

NPC owner null check

master
FatBoy-DOTC 1 year ago
parent
commit
3b3e89c98f
  1. 2
      src/engine/objects/Mob.java

2
src/engine/objects/Mob.java

@ -1393,7 +1393,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -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);

Loading…
Cancel
Save