Update to slotting logic.

This commit is contained in:
2023-08-27 21:25:43 -04:00
parent 85c2a4f4f0
commit 14a06410ae
+13 -1
View File
@@ -343,7 +343,19 @@ public enum NPCManager {
if (buildingSlot == -1) if (buildingSlot == -1)
Logger.error("No available slot for NPC: " + abstractCharacter.getObjectUUID()); 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 // Override bind and location for this npc derived
// from BuildingManager slot location data. // from BuildingManager slot location data.