From 43375a6f5bc1126c6ee6ce81c7a79e463223f8e4 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 21 Aug 2023 15:22:08 -0400 Subject: [PATCH] Only mobiles with contracts can be slotted. --- src/engine/gameManager/NPCManager.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/NPCManager.java b/src/engine/gameManager/NPCManager.java index 11deb263..6d468f0e 100644 --- a/src/engine/gameManager/NPCManager.java +++ b/src/engine/gameManager/NPCManager.java @@ -343,7 +343,16 @@ 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)) { + + Mob mobile = (Mob) abstractCharacter; + + if (mobile.contract != null) + abstractCharacter.building.getHirelings().put(abstractCharacter, buildingSlot); + } else + abstractCharacter.building.getHirelings().put(abstractCharacter, buildingSlot); // Override bind and location for this npc derived // from BuildingManager slot location data.