From 0c45e6d36f4aa5c454171faf9bfea1179a2a7cc9 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 29 Apr 2023 09:53:12 -0400 Subject: [PATCH] Serialization update. --- src/engine/objects/NPC.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 4b3e4482..51bf8be4 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -672,10 +672,10 @@ public class NPC extends AbstractCharacter { writer.putFloat(1.0f); writer.putFloat(1.0f); - writer.putFloat(npc.getLoc().getX()); - writer.putFloat(npc.getLoc().getY()); - writer.putFloat(npc.getLoc().getZ()); - + if (npc.region != null) + writer.putVector3f(ZoneManager.convertWorldToLocal(npc.building, npc.getLoc())); + else + writer.putVector3f(npc.getLoc()); //Rotation float radians = (float) Math.asin(npc.getRot().y) * 2;