mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
* Dirty PVS chunk when visibility mask changes * fix tests? * aaaaaa * maybe sorta finally fix tests * directly return vis mask, Also defaults to 1 only if visibility component does not exist. * make sure everything has first bit set
20 lines
547 B
C#
20 lines
547 B
C#
using Robust.Server.GameStates;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.IoC;
|
|
|
|
namespace Robust.Server.GameObjects;
|
|
|
|
public sealed class ServerMetaDataSystem : MetaDataSystem
|
|
{
|
|
[Dependency] private readonly PVSSystem _pvsSystem = default!;
|
|
|
|
public override void SetVisibilityMask(EntityUid uid, int value, MetaDataComponent? meta = null)
|
|
{
|
|
if (!Resolve(uid, ref meta) || meta.VisibilityMask == value)
|
|
return;
|
|
|
|
base.SetVisibilityMask(uid, value, meta);
|
|
_pvsSystem.MarkDirty(uid);
|
|
}
|
|
}
|