From 8ba4ed20c88d67b0dbf1b2ed56d851c8b0e826a3 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 20 Aug 2023 16:18:51 -0400 Subject: [PATCH] loc set to bindloc after npc returned. --- src/engine/gameManager/BuildingManager.java | 2 +- src/engine/objects/NPC.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index b194b93e..8baa980f 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -502,7 +502,7 @@ public enum BuildingManager { return false; npc.setBuilding(building); - WorldGrid.addObject(npc, contractOwner); + npc.setLoc(npc.bindLoc); return true; diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index b382d77a..d5705f4e 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -518,7 +518,9 @@ public class NPC extends AbstractCharacter { if (id == 0) return null; + NPC npc = (NPC) DbManager.getFromCache(GameObjectType.NPC, id); + if (npc != null) return npc;