From dc07718a7c4d4e92c8d29f933ebe3b8c7ea56702 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Fri, 18 Dec 2020 01:35:59 +0100 Subject: [PATCH] Fix click detection of sprite-rotated entities. --- Content.Client/GameObjects/Components/ClickableComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Client/GameObjects/Components/ClickableComponent.cs b/Content.Client/GameObjects/Components/ClickableComponent.cs index 63d4622648..d55c58affe 100644 --- a/Content.Client/GameObjects/Components/ClickableComponent.cs +++ b/Content.Client/GameObjects/Components/ClickableComponent.cs @@ -46,7 +46,7 @@ namespace Content.Client.GameObjects.Components var localPos = Owner.Transform.InvWorldMatrix.Transform(worldPos); - var worldRotation = Owner.Transform.WorldRotation; + var worldRotation = new Angle(Owner.Transform.WorldRotation - sprite.Rotation); if (sprite.Directional) { localPos = new Angle(worldRotation).RotateVec(localPos);