Prevent shoe buffs while crawling (#39648)
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
95b0df9a89
commit
47dd036ef2
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.Climbing.Events;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.Physics;
|
||||
@@ -69,12 +70,17 @@ public sealed class StandingStateSystem : EntitySystem
|
||||
ChangeLayers(entity);
|
||||
}
|
||||
|
||||
public bool IsDown(EntityUid uid, StandingStateComponent? standingState = null)
|
||||
public bool IsMatchingState(Entity<StandingStateComponent?> entity, bool standing)
|
||||
{
|
||||
if (!Resolve(uid, ref standingState, false))
|
||||
return standing != IsDown(entity);
|
||||
}
|
||||
|
||||
public bool IsDown(Entity<StandingStateComponent?> entity)
|
||||
{
|
||||
if (!Resolve(entity, ref entity.Comp, false))
|
||||
return false;
|
||||
|
||||
return !standingState.Standing;
|
||||
return !entity.Comp.Standing;
|
||||
}
|
||||
|
||||
public bool Down(EntityUid uid,
|
||||
@@ -213,29 +219,27 @@ public record struct DropHandItemsEvent();
|
||||
/// <summary>
|
||||
/// Subscribe if you can potentially block a down attempt.
|
||||
/// </summary>
|
||||
public sealed class DownAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
}
|
||||
public sealed class DownAttemptEvent : CancellableEntityEventArgs;
|
||||
|
||||
/// <summary>
|
||||
/// Subscribe if you can potentially block a stand attempt.
|
||||
/// </summary>
|
||||
public sealed class StandAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
}
|
||||
public sealed class StandAttemptEvent : CancellableEntityEventArgs;
|
||||
|
||||
/// <summary>
|
||||
/// Raised when an entity becomes standing
|
||||
/// </summary>
|
||||
public sealed class StoodEvent : EntityEventArgs
|
||||
public sealed class StoodEvent : EntityEventArgs, IInventoryRelayEvent
|
||||
{
|
||||
}
|
||||
public SlotFlags TargetSlots { get; } = SlotFlags.FEET;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Raised when an entity is not standing
|
||||
/// </summary>
|
||||
public sealed class DownedEvent : EntityEventArgs
|
||||
public sealed class DownedEvent : EntityEventArgs, IInventoryRelayEvent
|
||||
{
|
||||
public SlotFlags TargetSlots { get; } = SlotFlags.FEET;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user