From 098433b697ca3aba34e47d088cb8df8b48db831a Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 25 Aug 2023 15:46:09 -0400 Subject: [PATCH] Needs contract null check --- src/engine/objects/Mob.java | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 155db128..893d6aea 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1693,28 +1693,31 @@ public class Mob extends AbstractIntelligenceAgent { else this.contract = DbManager.ContractQueries.GET_CONTRACT(this.contractUUID); - // Guard captaiin AI + // Guard captain AI - if (NPC.ISGuardCaptain(contract.getContractID())) { - this.spawnTime = 60 * 15; - this.isPlayerGuard = true; - } + if (this.contract != null) { - // Load AI for wall archers + if (NPC.ISGuardCaptain(contract.getContractID())) { + this.spawnTime = 60 * 15; + this.isPlayerGuard = true; + } - if (this.contract != null && NPC.ISWallArcher(this.contract)) { - this.behaviourType = MobBehaviourType.GuardWallArcher; - this.isPlayerGuard = true; - this.spawnTime = 450; - } + // Load AI for wall archers - // Load AI for guard dogs + if (NPC.ISWallArcher(this.contract)) { + this.behaviourType = MobBehaviourType.GuardWallArcher; + this.isPlayerGuard = true; + this.spawnTime = 450; + } + + // Load AI for guard dogs - if (this.contract != null && this.contract.getContractID() == 910) { - this.isPlayerGuard = true; - this.behaviourType = MobBehaviourType.GuardCaptain; - this.spawnTime = 900; - this.guardedCity = ZoneManager.getCityAtLocation(this.bindLoc); + if (this.contract.getContractID() == 910) { + this.isPlayerGuard = true; + this.behaviourType = MobBehaviourType.GuardCaptain; + this.spawnTime = 900; + this.guardedCity = ZoneManager.getCityAtLocation(this.bindLoc); + } } if (this.building != null)