Skip to content

Commit e7b49ad

Browse files
author
Dolu
committed
fix(CodeWalker.Core): proper set rotation
Fixed a bug where changed entity rotation values ​​were not saved when using EntityRotationQuatBox in ytyp, but were only saved via widget rotation. Thanks to kirill-mapper: dexyfex#333
1 parent ac86f84 commit e7b49ad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,6 +1979,8 @@ public void SetOrientation(Quaternion ori, bool inverse = false)
19791979
Quaternion inv = Quaternion.Normalize(Quaternion.Invert(rel));
19801980
Orientation = ori;
19811981
_CEntityDef.rotation = inv.ToVector4();
1982+
UpdateBB();
1983+
UpdateMloArchetype();
19821984
}
19831985
else
19841986
{
@@ -1992,6 +1994,7 @@ public void SetOrientation(Quaternion ori, bool inverse = false)
19921994
Quaternion inv = inverse ? ori : Quaternion.Normalize(Quaternion.Invert(ori));
19931995
_CEntityDef.rotation = inv.ToVector4();
19941996
}
1997+
UpdateBB();
19951998
}
19961999

19972000
if (MloInstance != null)
@@ -2000,7 +2003,6 @@ public void SetOrientation(Quaternion ori, bool inverse = false)
20002003
MloInstance.UpdateEntities();
20012004
}
20022005

2003-
UpdateBB();
20042006
UpdateWidgetPosition();
20052007
UpdateWidgetOrientation();
20062008
}
@@ -2020,6 +2022,8 @@ public void SetOrientationRaw(Quaternion ori)
20202022
MloRefOrientation = Quaternion.Invert(MloRefOrientation);
20212023
}
20222024
Orientation = Quaternion.Multiply(MloParent.Orientation, MloRefOrientation);
2025+
UpdateBB();
2026+
UpdateMloArchetype();
20232027
}
20242028
else
20252029
{
@@ -2031,6 +2035,7 @@ public void SetOrientationRaw(Quaternion ori)
20312035
Orientation = Quaternion.Invert(Orientation);
20322036
}
20332037
}
2038+
UpdateBB();
20342039
}
20352040

20362041
if (MloInstance != null)
@@ -2039,7 +2044,6 @@ public void SetOrientationRaw(Quaternion ori)
20392044
MloInstance.UpdateEntities();
20402045
}
20412046

2042-
UpdateBB();
20432047
UpdateWidgetPosition();
20442048
UpdateWidgetOrientation();
20452049
}

0 commit comments

Comments
 (0)