Refactors stunnable to be ECS. (#4819)

Also cleans up StandingStatesystem.
This commit is contained in:
Vera Aguilera Puerto
2021-10-10 12:47:26 +02:00
committed by GitHub
parent 19a588a70a
commit 6eee256b11
34 changed files with 776 additions and 633 deletions

View File

@@ -2,12 +2,14 @@ using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Nutrition.Components;
using Content.Server.Nutrition.EntitySystems;
using Content.Server.Stunnable;
using Content.Server.Stunnable.Components;
using Content.Shared.Administration;
using Content.Shared.Damage;
using Content.Shared.Jittering;
using Content.Shared.MobState;
using Content.Shared.Nutrition.Components;
using Content.Shared.Stunnable;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
@@ -56,7 +58,11 @@ namespace Content.Server.Administration.Commands
target.GetComponentOrNull<IMobStateComponent>()?.UpdateState(0);
target.GetComponentOrNull<HungerComponent>()?.ResetFood();
target.GetComponentOrNull<ThirstComponent>()?.ResetThirst();
target.GetComponentOrNull<StunnableComponent>()?.ResetStuns();
if (target.TryGetComponent(out StunnableComponent? stunnable))
{
EntitySystem.Get<StunSystem>().Reset(target.Uid, stunnable);
}
if (target.TryGetComponent(out FlammableComponent? flammable))
{