Skip to content

Commit

Permalink
Requested Changes part 4
Browse files Browse the repository at this point in the history
  • Loading branch information
ScarKy0 committed Jan 15, 2025
1 parent 0828c0f commit 4d685ae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Content.Shared/ItemRecall/ItemRecallEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Content.Shared.ItemRecall;

/// <summary>
/// Raise on using the ItemRecall action.
/// Raised when using the ItemRecall action.
/// </summary>
[ByRefEvent]
public sealed partial class OnItemRecallActionEvent : InstantActionEvent;
Expand Down
4 changes: 2 additions & 2 deletions Content.Shared/ItemRecall/SharedItemRecallSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ private void RecallItem(Entity<RecallMarkerComponent> ent)
return;

if (TryComp<EmbeddableProjectileComponent>(ent, out var projectile))
_proj.UnEmbed(ent, ent.Comp.MarkedByEntity.Value, projectile);
_proj.UnEmbed(ent, projectile, ent.Comp.MarkedByEntity.Value);

_popups.PopupEntity(Loc.GetString("item-recall-item-summon", ("item", ent)), ent.Comp.MarkedByEntity.Value, ent.Comp.MarkedByEntity.Value);
_popups.PopupPredicted(Loc.GetString("item-recall-item-summon", ("item", ent)), ent.Comp.MarkedByEntity.Value, ent.Comp.MarkedByEntity.Value);

_hands.TryForcePickupAnyHand(ent.Comp.MarkedByEntity.Value, ent);
}
Expand Down
14 changes: 9 additions & 5 deletions Content.Shared/Projectiles/SharedProjectileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void OnEmbedRemove(EntityUid uid, EmbeddableProjectileComponent componen
return;
}

UnEmbed(uid, args.User, component);
UnEmbed(uid, component, args.User);

// try place it in the user's hand
_hands.TryPickupAnyHand(args.User, uid);
Expand Down Expand Up @@ -117,7 +117,7 @@ private void Embed(EntityUid uid, EntityUid target, EntityUid? user, EmbeddableP
Dirty(uid, component);
}

public void UnEmbed(EntityUid uid, EntityUid user, EmbeddableProjectileComponent? component)
public void UnEmbed(EntityUid uid, EmbeddableProjectileComponent? component, EntityUid? user = null)
{
if (!Resolve(uid, ref component))
return;
Expand All @@ -137,9 +137,13 @@ public void UnEmbed(EntityUid uid, EntityUid user, EmbeddableProjectileComponent
projectile.DamagedEntity = false;
}

// Land it just coz uhhh yeah
var landEv = new LandEvent(user, true);
RaiseLocalEvent(uid, ref landEv);
if (user != null)
{
// Land it just coz uhhh yeah
var landEv = new LandEvent(user, true);
RaiseLocalEvent(uid, ref landEv);
}

_physics.WakeBody(uid, body: physics);
}

Expand Down

0 comments on commit 4d685ae

Please sign in to comment.