Fix anchoring? Maybe? (#3974)

This commit is contained in:
Alex Evgrashin
2021-05-12 01:16:48 +03:00
committed by GitHub
parent 66fd927041
commit bf94e37730

View File

@@ -89,8 +89,6 @@ namespace Content.Server.GameObjects.Components
if (attempt.Cancelled)
return false;
_physicsComponent.BodyType = BodyType.Static;
// Snap rotation to cardinal (multiple of 90)
var rot = Owner.Transform.LocalRotation;
Owner.Transform.LocalRotation = Math.Round(rot / (Math.PI / 2)) * (Math.PI / 2);
@@ -106,6 +104,8 @@ namespace Content.Server.GameObjects.Components
if (Snap)
Owner.SnapToGrid(Owner.EntityManager);
_physicsComponent.BodyType = BodyType.Static;
Owner.EntityManager.EventBus.RaiseLocalEvent(Owner.Uid, new AnchoredMessage(), false);
return true;