Sloth's subfloor vismask adventure (#35347)
* Add a subfloor vismask Significantly cuts down on sent entity count. * More optimisations * Fix command * Fixes * namespace cleanup * Review * Vismasks * Content update * Bandaid * awewa * Revert these * reh * Update Content.Shared/SubFloor/TrayScannerComponent.cs --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -63,9 +63,16 @@ public sealed partial class RevenantSystem : EntitySystem
|
||||
SubscribeLocalEvent<RevenantComponent, StatusEffectEndedEvent>(OnStatusEnded);
|
||||
SubscribeLocalEvent<RoundEndTextAppendEvent>(_ => MakeVisible(true));
|
||||
|
||||
SubscribeLocalEvent<RevenantComponent, GetVisMaskEvent>(OnRevenantGetVis);
|
||||
|
||||
InitializeAbilities();
|
||||
}
|
||||
|
||||
private void OnRevenantGetVis(Entity<RevenantComponent> ent, ref GetVisMaskEvent args)
|
||||
{
|
||||
args.VisibilityMask |= (int)VisibilityFlags.Ghost;
|
||||
}
|
||||
|
||||
private void OnStartup(EntityUid uid, RevenantComponent component, ComponentStartup args)
|
||||
{
|
||||
//update the icon
|
||||
@@ -84,10 +91,7 @@ public sealed partial class RevenantSystem : EntitySystem
|
||||
}
|
||||
|
||||
//ghost vision
|
||||
if (TryComp(uid, out EyeComponent? eye))
|
||||
{
|
||||
_eye.SetVisibilityMask(uid, eye.VisibilityMask | (int) (VisibilityFlags.Ghost), eye);
|
||||
}
|
||||
_eye.RefreshVisibilityMask(uid);
|
||||
}
|
||||
|
||||
private void OnMapInit(EntityUid uid, RevenantComponent component, MapInitEvent args)
|
||||
|
||||
Reference in New Issue
Block a user