From ba642e049e5d7ed89d72a59930783fa165834337 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 28 May 2024 23:52:59 -0500 Subject: [PATCH] null check fix --- src/engine/objects/Mob.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 430e4787..a64968f3 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1711,7 +1711,10 @@ public class Mob extends AbstractIntelligenceAgent { this.behaviourType = MobBehaviourType.GuardCaptain; this.spawnTime = 60 * 15; this.isPlayerGuard = true; - this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc()); + if(ZoneManager.getCityAtLocation(this.building.getLoc()) != null) + this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc()); + else + this.guardedCity = null; } // Load AI for wall archers