Use Uid for standingstate methods (#4856)
This commit is contained in:
@@ -130,11 +130,11 @@ namespace Content.Server.Buckle.Components
|
|||||||
ownTransform.WorldRotation = strapTransform.WorldRotation;
|
ownTransform.WorldRotation = strapTransform.WorldRotation;
|
||||||
break;
|
break;
|
||||||
case StrapPosition.Stand:
|
case StrapPosition.Stand:
|
||||||
EntitySystem.Get<StandingStateSystem>().Stand(Owner);
|
EntitySystem.Get<StandingStateSystem>().Stand(Owner.Uid);
|
||||||
ownTransform.WorldRotation = strapTransform.WorldRotation;
|
ownTransform.WorldRotation = strapTransform.WorldRotation;
|
||||||
break;
|
break;
|
||||||
case StrapPosition.Down:
|
case StrapPosition.Down:
|
||||||
EntitySystem.Get<StandingStateSystem>().Down(Owner, false, false);
|
EntitySystem.Get<StandingStateSystem>().Down(Owner.Uid, false, false);
|
||||||
ownTransform.LocalRotation = Angle.Zero;
|
ownTransform.LocalRotation = Angle.Zero;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -339,11 +339,11 @@ namespace Content.Server.Buckle.Components
|
|||||||
if (_stunnable is { KnockedDown: true }
|
if (_stunnable is { KnockedDown: true }
|
||||||
|| (_mobState?.IsIncapacitated() ?? false))
|
|| (_mobState?.IsIncapacitated() ?? false))
|
||||||
{
|
{
|
||||||
EntitySystem.Get<StandingStateSystem>().Down(Owner);
|
EntitySystem.Get<StandingStateSystem>().Down(Owner.Uid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EntitySystem.Get<StandingStateSystem>().Stand(Owner);
|
EntitySystem.Get<StandingStateSystem>().Stand(Owner.Uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
_mobState?.CurrentState?.EnterState(Owner);
|
_mobState?.CurrentState?.EnterState(Owner);
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ namespace Content.Server.Instruments
|
|||||||
if (mob != null)
|
if (mob != null)
|
||||||
{
|
{
|
||||||
if (Handheld)
|
if (Handheld)
|
||||||
EntitySystem.Get<StandingStateSystem>().Down(mob, false);
|
EntitySystem.Get<StandingStateSystem>().Down(mob.Uid, false);
|
||||||
|
|
||||||
if (mob.TryGetComponent(out StunnableComponent? stun))
|
if (mob.TryGetComponent(out StunnableComponent? stun))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace Content.Server.Morgue.Components
|
|||||||
|
|
||||||
protected override bool AddToContents(IEntity entity)
|
protected override bool AddToContents(IEntity entity)
|
||||||
{
|
{
|
||||||
if (entity.HasComponent<SharedBodyComponent>() && !EntitySystem.Get<StandingStateSystem>().IsDown(entity)) return false;
|
if (entity.HasComponent<SharedBodyComponent>() && !EntitySystem.Get<StandingStateSystem>().IsDown(entity.Uid)) return false;
|
||||||
return base.AddToContents(entity);
|
return base.AddToContents(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ namespace Content.Server.Morgue.Components
|
|||||||
if (CanInsert(victim))
|
if (CanInsert(victim))
|
||||||
{
|
{
|
||||||
Insert(victim);
|
Insert(victim);
|
||||||
EntitySystem.Get<StandingStateSystem>().Down(victim, false);
|
EntitySystem.Get<StandingStateSystem>().Down(victim.Uid, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace Content.Server.Morgue.Components
|
|||||||
|
|
||||||
protected override bool AddToContents(IEntity entity)
|
protected override bool AddToContents(IEntity entity)
|
||||||
{
|
{
|
||||||
if (entity.HasComponent<SharedBodyComponent>() && !EntitySystem.Get<StandingStateSystem>().IsDown(entity))
|
if (entity.HasComponent<SharedBodyComponent>() && !EntitySystem.Get<StandingStateSystem>().IsDown(entity.Uid))
|
||||||
return false;
|
return false;
|
||||||
return base.AddToContents(entity);
|
return base.AddToContents(entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ namespace Content.Shared.Body.Components
|
|||||||
if (part.PartType == BodyPartType.Leg &&
|
if (part.PartType == BodyPartType.Leg &&
|
||||||
GetPartsOfType(BodyPartType.Leg).ToArray().Length == 0)
|
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)
|
if (part.IsVital && SlotParts.Count(x => x.Value.PartType == part.PartType) == 0)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Content.Shared.MobState.State
|
|||||||
{
|
{
|
||||||
base.ExitState(entity);
|
base.ExitState(entity);
|
||||||
|
|
||||||
EntitySystem.Get<StandingStateSystem>().Stand(entity);
|
EntitySystem.Get<StandingStateSystem>().Stand(entity.Uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanInteract()
|
public override bool CanInteract()
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ namespace Content.Shared.MobState.State
|
|||||||
var wake = entity.EnsureComponent<CollisionWakeComponent>();
|
var wake = entity.EnsureComponent<CollisionWakeComponent>();
|
||||||
wake.Enabled = true;
|
wake.Enabled = true;
|
||||||
var standingState = EntitySystem.Get<StandingStateSystem>();
|
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;
|
physics.CanCollide = false;
|
||||||
}
|
}
|
||||||
@@ -36,9 +36,9 @@ namespace Content.Shared.MobState.State
|
|||||||
}
|
}
|
||||||
|
|
||||||
var standingState = EntitySystem.Get<StandingStateSystem>();
|
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;
|
physics.CanCollide = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Content.Shared.MobState.State
|
|||||||
public override void EnterState(IEntity entity)
|
public override void EnterState(IEntity entity)
|
||||||
{
|
{
|
||||||
base.EnterState(entity);
|
base.EnterState(entity);
|
||||||
EntitySystem.Get<StandingStateSystem>().Stand(entity);
|
EntitySystem.Get<StandingStateSystem>().Stand(entity.Uid);
|
||||||
|
|
||||||
if (entity.TryGetComponent(out SharedAppearanceComponent? appearance))
|
if (entity.TryGetComponent(out SharedAppearanceComponent? appearance))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,12 +14,6 @@ namespace Content.Shared.Standing
|
|||||||
{
|
{
|
||||||
[Dependency] private readonly SharedHandsSystem _sharedHandsSystem = default!;
|
[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)
|
public bool IsDown(EntityUid uid, StandingStateComponent? standingState = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref standingState, false))
|
if (!Resolve(uid, ref standingState, false))
|
||||||
@@ -28,12 +22,6 @@ namespace Content.Shared.Standing
|
|||||||
return !standingState.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,
|
public bool Down(EntityUid uid, bool playSound = true, bool dropHeldItems = true,
|
||||||
StandingStateComponent? standingState = null,
|
StandingStateComponent? standingState = null,
|
||||||
SharedAppearanceComponent? appearance = null,
|
SharedAppearanceComponent? appearance = null,
|
||||||
@@ -80,12 +68,6 @@ namespace Content.Shared.Standing
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete("Use the EntityUid overloads instead.")]
|
|
||||||
public void Stand(IEntity entity)
|
|
||||||
{
|
|
||||||
Stand(entity.Uid);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Stand(EntityUid uid,
|
public bool Stand(EntityUid uid,
|
||||||
StandingStateComponent? standingState = null,
|
StandingStateComponent? standingState = null,
|
||||||
SharedAppearanceComponent? appearance = null)
|
SharedAppearanceComponent? appearance = null)
|
||||||
@@ -120,7 +102,6 @@ namespace Content.Shared.Standing
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class DownAttemptEvent : CancellableEntityEventArgs
|
public sealed class DownAttemptEvent : CancellableEntityEventArgs
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -128,7 +109,6 @@ namespace Content.Shared.Standing
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class StandAttemptEvent : CancellableEntityEventArgs
|
public sealed class StandAttemptEvent : CancellableEntityEventArgs
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user