From 26fe1c6df741c857c24f1ed716608d9e3496d694 Mon Sep 17 00:00:00 2001 From: Kirill <95088806+kirill-mapper@users.noreply.github.com> Date: Sun, 20 Apr 2025 03:02:05 +0300 Subject: [PATCH] Fix SetOrientation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed a bug where changed entity rotation values ​​were not saved when using EntityRotationQuatBox in ytyp, but were only saved via widget rotation. --- CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs b/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs index 9dd0f4ddc..5ae4c5517 100644 --- a/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs +++ b/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs @@ -1979,6 +1979,8 @@ public void SetOrientation(Quaternion ori, bool inverse = false) Quaternion inv = Quaternion.Normalize(Quaternion.Invert(rel)); Orientation = ori; _CEntityDef.rotation = inv.ToVector4(); + UpdateBB(); + UpdateMloArchetype(); } else { @@ -1992,6 +1994,7 @@ public void SetOrientation(Quaternion ori, bool inverse = false) Quaternion inv = inverse ? ori : Quaternion.Normalize(Quaternion.Invert(ori)); _CEntityDef.rotation = inv.ToVector4(); } + UpdateBB(); } if (MloInstance != null) @@ -2000,7 +2003,6 @@ public void SetOrientation(Quaternion ori, bool inverse = false) MloInstance.UpdateEntities(); } - UpdateBB(); UpdateWidgetPosition(); UpdateWidgetOrientation(); } @@ -2020,6 +2022,8 @@ public void SetOrientationRaw(Quaternion ori) MloRefOrientation = Quaternion.Invert(MloRefOrientation); } Orientation = Quaternion.Multiply(MloParent.Orientation, MloRefOrientation); + UpdateBB(); + UpdateMloArchetype(); } else { @@ -2031,6 +2035,7 @@ public void SetOrientationRaw(Quaternion ori) Orientation = Quaternion.Invert(Orientation); } } + UpdateBB(); } if (MloInstance != null) @@ -2039,7 +2044,6 @@ public void SetOrientationRaw(Quaternion ori) MloInstance.UpdateEntities(); } - UpdateBB(); UpdateWidgetPosition(); UpdateWidgetOrientation(); }