Reset eye lerp on parent map change (#12986)

This commit is contained in:
metalgearsloth
2023-01-12 23:10:51 +11:00
committed by GitHub
parent 098074fb61
commit ea16cc9fba

View File

@@ -158,6 +158,20 @@ namespace Content.Shared.Movement.Systems
return;
}
var oldMapId = args.OldMapId;
var mapId = args.Transform.MapID;
// If we change maps then reset eye rotation entirely.
if (oldMapId != mapId)
{
component.RelativeEntity = relative;
component.TargetRelativeRotation = Angle.Zero;
component.RelativeRotation = Angle.Zero;
component.LerpAccumulator = 0f;
Dirty(component);
return;
}
// If we go on a grid and back off then just reset the accumulator.
if (relative == component.RelativeEntity)
{