NPC derives position from slot.

This commit is contained in:
2023-04-29 10:30:53 -04:00
parent 0c45e6d36f
commit 5729492c6a
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -513,7 +513,7 @@ public enum BuildingManager {
} }
if (NPC.ISGuardCaptain(contract.getContractID())) { if (NPC.ISGuardCaptain(contract.getContractID())) {
mob = Mob.createMob( contract.getMobbaseID(), NpcLoc, contractOwner.getGuild(), true, zone, building, contract.getContractID(), pirateName, rank); mob = Mob.createMob(contract.getMobbaseID(), NpcLoc, contractOwner.getGuild(), true, zone, building, contract.getContractID(), pirateName, rank);
if (mob == null) if (mob == null)
return false; return false;
@@ -523,6 +523,12 @@ public enum BuildingManager {
mob.setParentZone(zone); mob.setParentZone(zone);
return true; return true;
} }
// NPC in a Building derives position from slot
if (building != null)
NpcLoc = Vector3fImmutable.ZERO;
npc = NPC.createNPC(pirateName, contract.getObjectUUID(), NpcLoc, contractOwner.getGuild(), false, zone, (short) rank, false, building); npc = NPC.createNPC(pirateName, contract.getObjectUUID(), NpcLoc, contractOwner.getGuild(), false, zone, (short) rank, false, building);
if (npc == null) if (npc == null)
+1 -1
View File
@@ -387,7 +387,7 @@ public class NPC extends AbstractCharacter {
// Configure region and floor/level for this NPC // Configure region and floor/level for this NPC
this.region = BuildingManager.GetRegion(this.building, slotLocation.x, slotLocation.y, slotLocation.z); this.region = BuildingManager.GetRegion(this.building, bindLoc.x, bindLoc.y, bindLoc.z);
if (this.region != null) { if (this.region != null) {
this.buildingFloor = region.getRoom(); this.buildingFloor = region.getRoom();