Fix replay eye rotation bug (#17625)

This commit is contained in:
Leon Friedrich
2023-06-25 19:05:40 +12:00
committed by GitHub
parent 7af0ae540d
commit a276b49376

View File

@@ -85,8 +85,13 @@ public sealed partial class ReplaySpectatorSystem
}
// A poor mans grid-traversal system. Should also interrupt ghost-following.
// This is very hacky and has already caused bugs.
// This is done the way it is because grid traversal gets processed in physics' SimulateWorld() update.
// TODO do this properly somehow.
_transform.SetGridId(player, xform, null);
_transform.AttachToGridOrMap(player);
if (xform.ParentUid.IsValid())
_transform.SetGridId(player, xform, Transform(xform.ParentUid).GridUid);
var parentRotation = _mover.GetParentGridAngle(mover, query);
var localVec = effectiveDir.AsDir().ToAngle().ToWorldVec();