Files
RobustToolbox/Robust.Server/GameObjects/Components/IgnorePauseComponent.cs
T
a274b8dfc2 EntityQuery no longer yields paused by default (#1521)
* Change EntityQuery to not get paused by default

* GetAllComponents

* Fix shell commands

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
2021-02-04 00:20:31 +11:00

28 lines
724 B
C#

using Robust.Server.Interfaces.Timing;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.IoC;
namespace Robust.Server.GameObjects.Components
{
[RegisterComponent]
[ComponentReference(typeof(SharedIgnorePauseComponent))]
public sealed class IgnorePauseComponent : SharedIgnorePauseComponent
{
public override void OnAdd()
{
base.OnAdd();
Owner.Paused = false;
}
public override void OnRemove()
{
base.OnRemove();
if (IoCManager.Resolve<IPauseManager>().IsMapPaused(Owner.Transform.MapID))
{
Owner.Paused = true;
}
}
}
}