Skip to content

Commit

Permalink
stop carrying if you get downed (#2576)
Browse files Browse the repository at this point in the history
Co-authored-by: deltanedas <@deltanedas:kde.org>
  • Loading branch information
deltanedas authored Jan 1, 2025
1 parent b0965ed commit 724c9f7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Content.Shared/_DV/Carrying/CarryingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public override void Initialize()
SubscribeLocalEvent<CarryingComponent, BeforeThrowEvent>(OnThrow);
SubscribeLocalEvent<CarryingComponent, EntParentChangedMessage>(OnParentChanged);
SubscribeLocalEvent<CarryingComponent, MobStateChangedEvent>(OnMobStateChanged);
SubscribeLocalEvent<CarryingComponent, DownedEvent>(OnDowned);
SubscribeLocalEvent<BeingCarriedComponent, InteractionAttemptEvent>(OnInteractionAttempt);
SubscribeLocalEvent<BeingCarriedComponent, UpdateCanMoveEvent>(OnMoveAttempt);
SubscribeLocalEvent<BeingCarriedComponent, StandAttemptEvent>(OnStandAttempt);
Expand Down Expand Up @@ -158,6 +159,11 @@ private void OnMobStateChanged(Entity<CarryingComponent> ent, ref MobStateChange
DropCarried(ent, ent.Comp.Carried);
}

private void OnDowned(Entity<CarryingComponent> ent, ref DownedEvent args)
{
DropCarried(ent, ent.Comp.Carried);
}

/// <summary>
/// Only let the person being carried interact with their carrier and things on their person.
/// </summary>
Expand Down

0 comments on commit 724c9f7

Please sign in to comment.