mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-16 07:12:27 +02:00
* Cut down RobustTree * Better LoD * Add PvsPriority flag * Undo cvar name change * reorganize grafana metrics * Fix tests * Fix replays * Don't try process empty chunks * Fix move benchmark * Fix benchmark * Remove obsolete audio methods * Moar benchmarks * Rename EntityData * A * B
33 lines
976 B
C#
33 lines
976 B
C#
using JetBrains.Annotations;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.IoC;
|
|
|
|
namespace Robust.Server.GameObjects;
|
|
|
|
[UsedImplicitly]
|
|
public sealed class ServerOccluderSystem : OccluderSystem
|
|
{
|
|
[Dependency] private readonly MetaDataSystem _metadata = default!;
|
|
|
|
protected override void OnCompStartup(EntityUid uid, OccluderComponent component, ComponentStartup args)
|
|
{
|
|
base.OnCompStartup(uid, component, args);
|
|
_metadata.SetFlag(uid, MetaDataFlags.PvsPriority, component.Enabled);
|
|
}
|
|
|
|
public override void SetEnabled(EntityUid uid, bool enabled, OccluderComponent? comp = null, MetaDataComponent? meta = null)
|
|
{
|
|
if (!Resolve(uid, ref comp, false))
|
|
return;
|
|
|
|
if (enabled == comp.Enabled)
|
|
return;
|
|
|
|
if (!Resolve(uid, ref meta))
|
|
return;
|
|
|
|
base.SetEnabled(uid, enabled, comp, meta);
|
|
_metadata.SetFlag((uid, meta), MetaDataFlags.PvsPriority, enabled);
|
|
}
|
|
}
|