Skip to content

Commit

Permalink
Fix Disposals Ejections (space-wizards#33468)
Browse files Browse the repository at this point in the history
* Fix disposals.

* Rename properly

---------

Co-authored-by: sleepyyapril <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>
  • Loading branch information
sleepyyapril authored Dec 9, 2024
1 parent 1510e89 commit 7fd8980
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,13 @@ public void ExitDisposals(EntityUid uid, DisposalHolderComponent? holder = null,
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);
}
}
}
Expand Down

0 comments on commit 7fd8980

Please sign in to comment.