From e67eff822d6718f792f236bb9ce1f8bf2a7b85c5 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 25 Aug 2023 16:44:45 -0400 Subject: [PATCH] Propagate guardedCity. --- src/engine/devcmd/cmds/aiInfoCmd.java | 3 +++ src/engine/objects/Mob.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/devcmd/cmds/aiInfoCmd.java b/src/engine/devcmd/cmds/aiInfoCmd.java index 85bf7bfd..695b24dc 100644 --- a/src/engine/devcmd/cmds/aiInfoCmd.java +++ b/src/engine/devcmd/cmds/aiInfoCmd.java @@ -84,6 +84,9 @@ public class aiInfoCmd extends AbstractDevCmd { else output += "Current Target: NULL" + newline; + if (mob.guardedCity != null) + output += mob.guardedCity.getCityName() + newline; + for (int token : mob.mobPowers.keySet()) output += token + newline; diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index cf875be4..f2c80087 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1696,6 +1696,7 @@ public class Mob extends AbstractIntelligenceAgent { if (NPC.ISGuardCaptain(contract.getContractID())) { this.spawnTime = 60 * 15; this.isPlayerGuard = true; + this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc()); } // Load AI for wall archers @@ -1704,6 +1705,7 @@ public class Mob extends AbstractIntelligenceAgent { this.behaviourType = MobBehaviourType.GuardWallArcher; this.isPlayerGuard = true; this.spawnTime = 450; + this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc()); } // Load AI for guard dogs @@ -1712,7 +1714,7 @@ public class Mob extends AbstractIntelligenceAgent { this.isPlayerGuard = true; this.behaviourType = MobBehaviourType.GuardCaptain; this.spawnTime = 900; - this.guardedCity = ZoneManager.getCityAtLocation(this.bindLoc); + this.guardedCity = ZoneManager.getCityAtLocation(this.building.getLoc()); } }