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;