diff --git a/Content.Shared/MobState/EntitySystems/MobStateSystem.cs b/Content.Shared/MobState/EntitySystems/MobStateSystem.cs index 045b3634f4..39c3353195 100644 --- a/Content.Shared/MobState/EntitySystems/MobStateSystem.cs +++ b/Content.Shared/MobState/EntitySystems/MobStateSystem.cs @@ -3,6 +3,7 @@ using Content.Shared.MobState.Components; using Content.Shared.MobState.State; using Content.Shared.Movement; using Content.Shared.Pulling.Events; +using Content.Shared.Standing; using Robust.Shared.GameObjects; namespace Content.Shared.MobState.EntitySystems @@ -16,6 +17,8 @@ namespace Content.Shared.MobState.EntitySystems SubscribeLocalEvent(OnStartPullAttempt); SubscribeLocalEvent(UpdateState); SubscribeLocalEvent(OnMoveAttempt); + SubscribeLocalEvent(OnStandAttempt); + // Note that there's no check for Down attempts because if a mob's in crit or dead, they can be downed... } private void OnStartPullAttempt(EntityUid uid, MobStateComponent component, StartPullAttemptEvent args) @@ -28,7 +31,7 @@ namespace Content.Shared.MobState.EntitySystems { component.UpdateState(args.Damageable.TotalDamage); } - + private void OnMoveAttempt(EntityUid uid, MobStateComponent component, MovementAttemptEvent args) { switch (component.CurrentState) @@ -41,5 +44,11 @@ namespace Content.Shared.MobState.EntitySystems return; } } + + private void OnStandAttempt(EntityUid uid, MobStateComponent component, StandAttemptEvent args) + { + if(component.IsIncapacitated()) + args.Cancel(); + } } } diff --git a/Content.Shared/MobState/State/SharedCriticalMobState.cs b/Content.Shared/MobState/State/SharedCriticalMobState.cs index 35683f2bb2..099fd1d4ac 100644 --- a/Content.Shared/MobState/State/SharedCriticalMobState.cs +++ b/Content.Shared/MobState/State/SharedCriticalMobState.cs @@ -21,7 +21,7 @@ namespace Content.Shared.MobState.State status.ShowAlert(AlertType.HumanCrit); // TODO: combine humancrit-0 and humancrit-1 into a gif and display it } - EntitySystem.Get().Down(entity); + EntitySystem.Get().Down(entity.Uid); if (entity.TryGetComponent(out SharedAppearanceComponent? appearance)) { diff --git a/Resources/Changelog/Parts/down.yml b/Resources/Changelog/Parts/down.yml new file mode 100644 index 0000000000..002391d768 --- /dev/null +++ b/Resources/Changelog/Parts/down.yml @@ -0,0 +1,4 @@ +author: Zumorica +changes: + - type: Fix # One of the following: Add, Remove, Tweak, Fix + message: Fixed mobs that die or go into crit not being downed.