stop carrying if you get downed (#2576)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2025-01-01 17:25:09 +00:00
committed by GitHub
co-authored by deltanedas
parent b0965ed2a4
commit 724c9f7d0e
@@ -57,6 +57,7 @@ public sealed class CarryingSystem : EntitySystem
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);
@@ -158,6 +159,11 @@ public sealed class CarryingSystem : EntitySystem
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>