]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix EmbeddableProjectileComponent and ThrowingAngleComponent interaction (#30112)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Fri, 19 Jul 2024 09:42:58 +0000 (11:42 +0200)
committerGitHub <noreply@github.com>
Fri, 19 Jul 2024 09:42:58 +0000 (19:42 +1000)
* fix embeddable offset with throwing angle

* number

Content.Shared/Projectiles/SharedProjectileSystem.cs
Resources/Prototypes/Entities/Objects/Weapons/Melee/spear.yml

index b718c3a690081e0365b32d4a4a1b84e49870720e..1f6f2b6918faa9bf30b139af93df18ba39158f22 100644 (file)
@@ -120,7 +120,10 @@ public abstract partial class SharedProjectileSystem : EntitySystem
 
         if (component.Offset != Vector2.Zero)
         {
-            _transform.SetLocalPosition(uid, xform.LocalPosition + xform.LocalRotation.RotateVec(component.Offset),
+            var rotation = xform.LocalRotation;
+            if (TryComp<ThrowingAngleComponent>(uid, out var throwingAngleComp))
+                rotation += throwingAngleComp.Angle;
+            _transform.SetLocalPosition(uid, xform.LocalPosition + rotation.RotateVec(component.Offset),
                 xform);
         }
 
index ea2e73ac151750f3a0cf6bd255dedc8ccc4fe9bd..608fb2544ae82f03f781587c068b466e9f7df540 100644 (file)
@@ -5,7 +5,7 @@
   description: Definition of a Classic. Keeping murder affordable since 200,000 BCE.
   components:
   - type: EmbeddableProjectile
-    offset: 0.15,0.15
+    offset: -0.15,0.0
   - type: ThrowingAngle
     angle: 225
   - type: LandAtCursor