Visibility moved from session to EyeComponent (#1657)

This commit is contained in:
Acruid
2021-03-26 14:38:45 -07:00
committed by GitHub
parent 4864096b2a
commit 7ed722f669
5 changed files with 32 additions and 11 deletions

View File

@@ -471,8 +471,11 @@ namespace Robust.Server.GameObjects
// scan pvs box and include children and parents recursively
IncludeRelatives(GetEntitiesInRange(mapId, position, range, true), relatives);
if (player.AttachedEntity is null || !player.AttachedEntity.TryGetComponent<EyeComponent>(out var eyeComp))
eyeComp = null;
// Exclude any entities that are currently invisible to the player.
ExcludeInvisible(relatives, player.VisibilityMask);
ExcludeInvisible(relatives, (int)(eyeComp?.VisibilityMask ?? 0));
// Always send updates for all grid and map entities.
// If we don't, the client-side game state manager WILL blow up.