From 14a06410ae53f3510cfe1a99fdf47f075a255b69 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 27 Aug 2023 21:25:43 -0400 Subject: [PATCH] Update to slotting logic. --- src/engine/gameManager/NPCManager.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/NPCManager.java b/src/engine/gameManager/NPCManager.java index 4a0d7511..e16533b0 100644 --- a/src/engine/gameManager/NPCManager.java +++ b/src/engine/gameManager/NPCManager.java @@ -343,7 +343,19 @@ public enum NPCManager { if (buildingSlot == -1) Logger.error("No available slot for NPC: " + abstractCharacter.getObjectUUID()); - abstractCharacter.building.getHirelings().put(abstractCharacter, buildingSlot); + // Pets are regular mobiles not hirelings (Siege engines) + + if (!abstractCharacter.getObjectType().equals(Enum.GameObjectType.Mob)) + abstractCharacter.building.getHirelings().put(abstractCharacter, buildingSlot); + else { + Mob mobile = (Mob) abstractCharacter; + + // Siege engines are not hirelings but minions of said hireling. + + if (mobile.behaviourType.equals(Enum.MobBehaviourType.SiegeEngine) || + mobile.behaviourType.equals(Enum.MobBehaviourType.GuardCaptain)) + abstractCharacter.building.getHirelings().put(abstractCharacter, buildingSlot); + } // Override bind and location for this npc derived // from BuildingManager slot location data.