From 11c154e564b66c36ea11480b3c32218a9806ac23 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 31 Aug 2023 08:58:55 -0400 Subject: [PATCH] Assignment fix and comment cleanup. --- src/engine/gameManager/BuildingManager.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index b13065fd..7a2a2020 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -540,11 +540,12 @@ public enum BuildingManager { if (mobile == null) return false; - // Configure AI. + // Configure AI and write new mobile to disk mobile.behaviourType = Enum.MobBehaviourType.GuardWallArcher; + mobile = DbManager.MobQueries.PERSIST(mobile); - DbManager.MobQueries.PERSIST(mobile); + // Spawn new mobile mobile.setLoc(mobile.getLoc()); @@ -558,11 +559,12 @@ public enum BuildingManager { if (mobile == null) return false; - // Configure AI. + // Configure AI and write new mobile to disk mobile.behaviourType = Enum.MobBehaviourType.GuardCaptain; + mobile = DbManager.MobQueries.PERSIST(mobile); - DbManager.MobQueries.PERSIST(mobile); + // Spawn new mobile mobile.setLoc(mobile.getLoc()); @@ -577,11 +579,13 @@ public enum BuildingManager { if (mobile == null) return false; - // Configure AI. + // Configure AI and write new mobile to disk mobile.behaviourType = Enum.MobBehaviourType.GuardCaptain; + mobile = DbManager.MobQueries.PERSIST(mobile); + + // Spawn new mobile - DbManager.MobQueries.PERSIST(mobile); mobile.setLoc(mobile.getLoc()); return true;