]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix Disposals Ejections (#33468)
authorsleepyyapril <123355664+sleepyyapril@users.noreply.github.com>
Mon, 9 Dec 2024 04:08:07 +0000 (00:08 -0400)
committerGitHub <noreply@github.com>
Mon, 9 Dec 2024 04:08:07 +0000 (22:08 -0600)
* Fix disposals.

* Rename properly

---------

Co-authored-by: sleepyyapril <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>
Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs

index 38e3923803941aa35082a5c323106f525ce150a4..064f9300b3c6f383e1c98e9e457fe84acb043fd4 100644 (file)
@@ -135,12 +135,13 @@ namespace Content.Server.Disposal.Unit.EntitySystems
                 else
                 {
                     _xformSystem.AttachToGridOrMap(entity, xform);
+                    var direction = holder.CurrentDirection == Direction.Invalid ? holder.PreviousDirection : holder.CurrentDirection;
 
-                    if (holder.PreviousDirection != Direction.Invalid && _xformQuery.TryGetComponent(xform.ParentUid, out var parentXform))
+                    if (direction != Direction.Invalid && _xformQuery.TryGetComponent(gridUid, out var gridXform))
                     {
-                        var direction = holder.PreviousDirection.ToAngle();
-                        direction += _xformSystem.GetWorldRotation(parentXform);
-                        _throwing.TryThrow(entity, direction.ToWorldVec() * 3f, 10f);
+                        var directionAngle = direction.ToAngle();
+                        directionAngle += _xformSystem.GetWorldRotation(gridXform);
+                        _throwing.TryThrow(entity, directionAngle.ToWorldVec() * 3f, 10f);
                     }
                 }
             }