Snap to nearest cardinal on traversal (#10869)

This commit is contained in:
metalgearsloth
2022-08-29 15:59:19 +10:00
committed by GitHub
parent fe177f4a3e
commit 3fa666bd06
54 changed files with 222 additions and 49 deletions

View File

@@ -10,6 +10,7 @@ using Content.Shared.Input;
using Content.Shared.Interaction.Components;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Content.Shared.Movement.Components;
using Content.Shared.Physics;
using Content.Shared.Popups;
using Content.Shared.Throwing;
@@ -797,7 +798,16 @@ namespace Content.Shared.Interaction
RaiseLocalEvent(item, dropMsg, true);
if (dropMsg.Handled)
_adminLogger.Add(LogType.Drop, LogImpact.Low, $"{ToPrettyString(user):user} dropped {ToPrettyString(item):entity}");
Transform(item).LocalRotation = Angle.Zero;
// If the dropper is rotated then use their targetrelativerotation as the drop rotation
var rotation = Angle.Zero;
if (TryComp<InputMoverComponent>(user, out var mover))
{
rotation = mover.TargetRelativeRotation;
}
Transform(item).LocalRotation = rotation;
}
#endregion