From c8b7dcc702f4305886340475de3f8be1e08ca9c2 Mon Sep 17 00:00:00 2001 From: mischa Date: Sun, 14 Jul 2024 10:18:36 +0200 Subject: [PATCH] NetworkIdentity.DirtyMasks: syntax simplified further --- Assets/Mirror/Core/NetworkIdentity.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Assets/Mirror/Core/NetworkIdentity.cs b/Assets/Mirror/Core/NetworkIdentity.cs index a9008dccb..645c024f7 100644 --- a/Assets/Mirror/Core/NetworkIdentity.cs +++ b/Assets/Mirror/Core/NetworkIdentity.cs @@ -857,14 +857,17 @@ internal void OnStopLocalPlayer() if (initialState || (component.syncDirection == SyncDirection.ServerToClient && dirty)) ownerMask |= nthBit; - // observers need to be considered only in Observers mode - // - // for initial, it should always sync to observers. - // for delta, only if dirty. - // SyncDirection is irrelevant, as both are broadcast to - // observers which aren't the owner. - if (component.syncMode == SyncMode.Observers && (initialState || dirty)) - observerMask |= nthBit; + // observers need to be considered only in Observers mode, + // otherwise they receive no sync data of this component ever. + if (component.syncMode == SyncMode.Observers) + { + // for initial, it should always sync to observers. + // for delta, only if dirty. + // SyncDirection is irrelevant, as both are broadcast to + // observers which aren't the owner. + if (initialState || dirty) + observerMask |= nthBit; + } } return (ownerMask, observerMask);