Skip to content

Commit

Permalink
Fix Freezing on throwing jetpack (space-wizards#30223)
Browse files Browse the repository at this point in the history
* Fix Freezing on throwing jetpack

* bweep(requested stuff)
  • Loading branch information
Cojoke-dot authored and themias committed Aug 9, 2024
1 parent c9a9356 commit 2e77003
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Content.Shared/Hands/EntitySystems/SharedHandsSystem.Drop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Shared.Interaction;
using Content.Shared.Inventory.VirtualItem;
using Content.Shared.Tag;
using Content.Shared.Interaction.Events;
using Robust.Shared.Containers;
using Robust.Shared.Map;

Expand Down Expand Up @@ -125,15 +126,13 @@ public bool TryDrop(EntityUid uid, Hand hand, EntityCoordinates? targetDropLocat
var userXform = Transform(uid);
var isInContainer = ContainerSystem.IsEntityOrParentInContainer(uid, xform: userXform);

DoDrop(uid, hand, doDropInteraction: doDropInteraction, handsComp);

// drop the item inside the container if the user is in a container
if (targetDropLocation == null || isInContainer)
{
TransformSystem.DropNextTo((entity, itemXform), (uid, userXform));
return true;
}

// otherwise, remove the item from their hands and place it at the calculated interaction range position
DoDrop(uid, hand, doDropInteraction: doDropInteraction, handsComp);
var (itemPos, itemRot) = TransformSystem.GetWorldPositionRotation(entity);
var origin = new MapCoordinates(itemPos, itemXform.MapID);
var target = TransformSystem.ToMapCoordinates(targetDropLocation.Value);
Expand Down

0 comments on commit 2e77003

Please sign in to comment.