Truncate melee wide swings (#16242)

This commit is contained in:
metalgearsloth
2023-05-08 17:46:26 +10:00
committed by GitHub
parent 211ba8c7bd
commit 3ed58be49c
3 changed files with 34 additions and 19 deletions

View File

@@ -154,12 +154,12 @@ public sealed partial class MeleeWeaponSystem
break;
case WeaponArcAnimation.None:
var xformQuery = GetEntityQuery<TransformComponent>();
var (mapPos, mapRot) = _transform.GetWorldPositionRotation(userXform, xformQuery);
var (mapPos, mapRot) = TransformSystem.GetWorldPositionRotation(userXform, xformQuery);
var xform = xformQuery.GetComponent(animationUid);
xform.AttachToGridOrMap();
var worldPos = mapPos + (mapRot - userXform.LocalRotation).RotateVec(localPos);
var newLocalPos = _transform.GetInvWorldMatrix(xform.ParentUid, xformQuery).Transform(worldPos);
_transform.SetLocalPositionNoLerp(xform, newLocalPos);
var newLocalPos = TransformSystem.GetInvWorldMatrix(xform.ParentUid, xformQuery).Transform(worldPos);
TransformSystem.SetLocalPositionNoLerp(xform, newLocalPos);
if (arcComponent.Fadeout)
_animation.Play(animationUid, GetFadeAnimation(sprite, 0f, 0.15f), FadeAnimationKey);
break;