From c30ca2fb1ff3112a56eec1b7044c3914c7305d69 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 29 Apr 2023 09:21:58 -0400 Subject: [PATCH] Comment cleanup. --- src/engine/objects/NPC.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 8a70788f..4b3e4482 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -358,6 +358,7 @@ public class NPC extends AbstractCharacter { this.parentZone.zoneNPCSet.add(this); // Setup location for this NPC + this.bindLoc = new Vector3fImmutable(this.statLat, this.statAlt, this.statLon); this.bindLoc = this.parentZone.getLoc().add(this.bindLoc); this.loc = new Vector3fImmutable(bindLoc); @@ -366,6 +367,9 @@ public class NPC extends AbstractCharacter { if (this.building != null) { + // Get next available slot for this NPC and use it + // to add the NPC to the building's hireling list + slot = BuildingManager.getAvailableSlot(building); if (slot == -1) @@ -373,11 +377,16 @@ public class NPC extends AbstractCharacter { building.getHirelings().put(this, slot); + // Override bind and location for this npc derived + // from BuildingManager slot location data. + slotLocation = BuildingManager.getSlotLocation(building, slot); this.bindLoc = building.getLoc().add(slotLocation); this.loc = building.getLoc().add(slotLocation); - ; + + // Configure region and floor/level for this NPC + this.region = BuildingManager.GetRegion(this.building, slotLocation.x, slotLocation.y, slotLocation.z); if (this.region != null) {