NPC wake / sleep cleanup (#5679)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.AI.EntitySystems;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Roles;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -19,6 +20,29 @@ namespace Content.Server.AI.Components
|
||||
|
||||
public override string Name => "AiController";
|
||||
|
||||
// TODO: Need to ECS a lot more of the AI first before we can ECS this
|
||||
/// <summary>
|
||||
/// Whether the AI is actively iterated.
|
||||
/// </summary>
|
||||
public bool Awake
|
||||
{
|
||||
get => _awake;
|
||||
set
|
||||
{
|
||||
if (_awake == value) return;
|
||||
|
||||
_awake = value;
|
||||
|
||||
if (_awake)
|
||||
EntitySystem.Get<NPCSystem>().WakeNPC(this);
|
||||
else
|
||||
EntitySystem.Get<NPCSystem>().SleepNPC(this);
|
||||
}
|
||||
}
|
||||
|
||||
[DataField("awake")]
|
||||
private bool _awake = true;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("startingGear")]
|
||||
public string? StartingGearPrototype { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user