Fix click detection of sprite-rotated entities.

This commit is contained in:
Pieter-Jan Briers
2020-12-18 01:35:59 +01:00
parent 12088ee111
commit dc07718a7c

View File

@@ -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);