From 1ab8540f7320bab663cdf2f2cad813b8d057cb6c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 30 Apr 2023 09:32:34 -0400 Subject: [PATCH] Location serialization matches NPC --- src/engine/objects/Mob.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 71408ec5..31c3c8d3 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -362,8 +362,13 @@ public class Mob extends AbstractIntelligenceAgent { writer.putVector3f(mob.getLoc()); //Rotation + float radians = (float) Math.asin(mob.getRot().y) * 2; - writer.putFloat(mob.getRot().y); + if (mob.building != null) + if (mob.building.getBounds() != null && mob.building.getBounds().getQuaternion() != null) + radians += (mob.building.getBounds().getQuaternion()).angleY; + + writer.putFloat(radians); //Inventory Stuff