From 89a4265dda3981f814c2440876a76cdf464aba4d Mon Sep 17 00:00:00 2001 From: Tad Hardesty Date: Fri, 7 Feb 2020 08:54:56 -0800 Subject: [PATCH] Change player's facing when they click on something (#598) --- .../GameObjects/EntitySystems/Click/InteractionSystem.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index b1c647f951..df7f6ea42a 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -17,6 +17,7 @@ using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Map; +using Robust.Shared.Maths; using Robust.Shared.Players; namespace Content.Server.GameObjects.EntitySystems @@ -409,6 +410,8 @@ namespace Content.Server.GameObjects.EntitySystems return; } + playerTransform.LocalRotation = new Angle(coordinates.ToMapPos(_mapManager) - playerTransform.MapPosition.Position); + // TODO: Check if client should be able to see that object to click on it in the first place // Clicked on empty space behavior, try using ranged attack