Use Uid for standingstate methods (#4856)

This commit is contained in:
metalgearsloth
2021-10-13 18:58:18 +11:00
committed by GitHub
parent 60da7aeb8d
commit 2f3914e01e
10 changed files with 15 additions and 35 deletions

View File

@@ -186,7 +186,7 @@ namespace Content.Shared.Body.Components
if (part.PartType == BodyPartType.Leg &&
GetPartsOfType(BodyPartType.Leg).ToArray().Length == 0)
{
EntitySystem.Get<StandingStateSystem>().Down(Owner);
EntitySystem.Get<StandingStateSystem>().Down(Owner.Uid);
}
if (part.IsVital && SlotParts.Count(x => x.Value.PartType == part.PartType) == 0)

View File

@@ -33,7 +33,7 @@ namespace Content.Shared.MobState.State
{
base.ExitState(entity);
EntitySystem.Get<StandingStateSystem>().Stand(entity);
EntitySystem.Get<StandingStateSystem>().Stand(entity.Uid);
}
public override bool CanInteract()

View File

@@ -14,9 +14,9 @@ namespace Content.Shared.MobState.State
var wake = entity.EnsureComponent<CollisionWakeComponent>();
wake.Enabled = true;
var standingState = EntitySystem.Get<StandingStateSystem>();
standingState.Down(entity);
standingState.Down(entity.Uid);
if (standingState.IsDown(entity) && entity.TryGetComponent(out PhysicsComponent? physics))
if (standingState.IsDown(entity.Uid) && entity.TryGetComponent(out PhysicsComponent? physics))
{
physics.CanCollide = false;
}
@@ -36,9 +36,9 @@ namespace Content.Shared.MobState.State
}
var standingState = EntitySystem.Get<StandingStateSystem>();
standingState.Stand(entity);
standingState.Stand(entity.Uid);
if (!standingState.IsDown(entity) && entity.TryGetComponent(out PhysicsComponent? physics))
if (!standingState.IsDown(entity.Uid) && entity.TryGetComponent(out PhysicsComponent? physics))
{
physics.CanCollide = true;
}

View File

@@ -14,7 +14,7 @@ namespace Content.Shared.MobState.State
public override void EnterState(IEntity entity)
{
base.EnterState(entity);
EntitySystem.Get<StandingStateSystem>().Stand(entity);
EntitySystem.Get<StandingStateSystem>().Stand(entity.Uid);
if (entity.TryGetComponent(out SharedAppearanceComponent? appearance))
{

View File

@@ -14,12 +14,6 @@ namespace Content.Shared.Standing
{
[Dependency] private readonly SharedHandsSystem _sharedHandsSystem = default!;
[Obsolete("Use the EntityUid overloads instead.")]
public bool IsDown(IEntity entity)
{
return IsDown(entity.Uid);
}
public bool IsDown(EntityUid uid, StandingStateComponent? standingState = null)
{
if (!Resolve(uid, ref standingState, false))
@@ -28,12 +22,6 @@ namespace Content.Shared.Standing
return !standingState.Standing;
}
[Obsolete("Use the EntityUid overloads instead.")]
public void Down(IEntity entity, bool playSound = true, bool dropHeldItems = true)
{
Down(entity.Uid, playSound, dropHeldItems);
}
public bool Down(EntityUid uid, bool playSound = true, bool dropHeldItems = true,
StandingStateComponent? standingState = null,
SharedAppearanceComponent? appearance = null,
@@ -80,12 +68,6 @@ namespace Content.Shared.Standing
return true;
}
[Obsolete("Use the EntityUid overloads instead.")]
public void Stand(IEntity entity)
{
Stand(entity.Uid);
}
public bool Stand(EntityUid uid,
StandingStateComponent? standingState = null,
SharedAppearanceComponent? appearance = null)
@@ -120,7 +102,6 @@ namespace Content.Shared.Standing
/// </summary>
public sealed class DownAttemptEvent : CancellableEntityEventArgs
{
}
/// <summary>
@@ -128,7 +109,6 @@ namespace Content.Shared.Standing
/// </summary>
public sealed class StandAttemptEvent : CancellableEntityEventArgs
{
}
/// <summary>