Skip to content

Commit

Permalink
fix: add event handling
Browse files Browse the repository at this point in the history
Signed-off-by: Remuchi <[email protected]>
  • Loading branch information
Remuchi committed Nov 19, 2024
1 parent 213497f commit d05b951
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,16 @@ private void OnPickedUp(Entity<BloodSpearComponent> spear, ref GettingPickedUpAt

private void OnSpearRecalled(Entity<BloodCultistComponent> cultist, ref BloodSpearRecalledEvent args)
{
if (args.Handled)
return;

var spearUid = cultist.Comp.BloodSpear;
if (!spearUid.HasValue || !TryComp(spearUid, out BloodSpearComponent? spear))
return;

_hands.TryForcePickupAnyHand(cultist, spearUid.Value);
_audio.PlayPvs(spear.RecallAudio, spearUid.Value);
args.Handled = true;
}

public void DetachSpearFromMaster(Entity<BloodCultistComponent> cultist)
Expand Down

0 comments on commit d05b951

Please sign in to comment.