Fix a few warnings (#11576)
This commit is contained in:
@@ -8,18 +8,13 @@ public abstract partial class SharedMobStateSystem
|
||||
public virtual void EnterCritState(EntityUid uid)
|
||||
{
|
||||
Alerts.ShowAlert(uid, AlertType.HumanCrit);
|
||||
|
||||
Standing.Down(uid);
|
||||
|
||||
if (TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
{
|
||||
appearance.SetData(DamageStateVisuals.State, DamageState.Critical);
|
||||
}
|
||||
_standing.Down(uid);
|
||||
_appearance.SetData(uid, DamageStateVisuals.State, DamageState.Critical);
|
||||
}
|
||||
|
||||
public virtual void ExitCritState(EntityUid uid)
|
||||
{
|
||||
Standing.Stand(uid);
|
||||
_standing.Stand(uid);
|
||||
}
|
||||
|
||||
public virtual void UpdateCritState(EntityUid entity, FixedPoint2 threshold) {}
|
||||
|
||||
@@ -8,28 +8,25 @@ public abstract partial class SharedMobStateSystem
|
||||
public virtual void EnterDeadState(EntityUid uid)
|
||||
{
|
||||
EnsureComp<CollisionWakeComponent>(uid);
|
||||
Standing.Down(uid);
|
||||
_standing.Down(uid);
|
||||
|
||||
if (Standing.IsDown(uid) && TryComp<PhysicsComponent>(uid, out var physics))
|
||||
if (_standing.IsDown(uid) && TryComp<PhysicsComponent>(uid, out var physics))
|
||||
{
|
||||
physics.CanCollide = false;
|
||||
_physics.SetCanCollide(physics, false);
|
||||
}
|
||||
|
||||
if (TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
{
|
||||
appearance.SetData(DamageStateVisuals.State, DamageState.Dead);
|
||||
}
|
||||
_appearance.SetData(uid, DamageStateVisuals.State, DamageState.Dead);
|
||||
}
|
||||
|
||||
public virtual void ExitDeadState(EntityUid uid)
|
||||
{
|
||||
RemComp<CollisionWakeComponent>(uid);
|
||||
|
||||
Standing.Stand(uid);
|
||||
_standing.Stand(uid);
|
||||
|
||||
if (!Standing.IsDown(uid) && TryComp<PhysicsComponent>(uid, out var physics))
|
||||
if (!_standing.IsDown(uid) && TryComp<PhysicsComponent>(uid, out var physics))
|
||||
{
|
||||
physics.CanCollide = true;
|
||||
_physics.SetCanCollide(physics, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,12 +6,8 @@ public abstract partial class SharedMobStateSystem
|
||||
{
|
||||
public virtual void EnterNormState(EntityUid uid)
|
||||
{
|
||||
Standing.Stand(uid);
|
||||
|
||||
if (TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
{
|
||||
appearance.SetData(DamageStateVisuals.State, DamageState.Alive);
|
||||
}
|
||||
_standing.Stand(uid);
|
||||
_appearance.SetData(uid, DamageStateVisuals.State, DamageState.Alive);
|
||||
}
|
||||
|
||||
public virtual void UpdateNormState(EntityUid entity, FixedPoint2 threshold) {}
|
||||
|
||||
@@ -15,6 +15,7 @@ using Content.Shared.Speech;
|
||||
using Content.Shared.Standing;
|
||||
using Content.Shared.StatusEffect;
|
||||
using Content.Shared.Throwing;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.MobState.EntitySystems
|
||||
@@ -22,9 +23,11 @@ namespace Content.Shared.MobState.EntitySystems
|
||||
public abstract partial class SharedMobStateSystem : EntitySystem
|
||||
{
|
||||
[Dependency] protected readonly AlertsSystem Alerts = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
||||
[Dependency] protected readonly StandingStateSystem Standing = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] protected readonly StatusEffectsSystem Status = default!;
|
||||
[Dependency] private readonly StandingStateSystem _standing = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user