Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Assets/Mirror/Core/NetworkBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ public abstract class NetworkBehaviour : MonoBehaviour
//
// also note that this is a per-NetworkBehaviour flag.
// another component may not be client authoritative, etc.
//
// checking isServer firstly in case we are in host mode
// otherwise checking isClient && isOwned
// otherwise no authority
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3529
public bool authority =>
isClient
? syncDirection == SyncDirection.ClientToServer && isOwned
: syncDirection == SyncDirection.ServerToClient;
isServer && syncDirection == SyncDirection.ServerToClient ||
isClient && syncDirection == SyncDirection.ClientToServer && isOwned;

/// <summary>The unique network Id of this object (unique at runtime).</summary>
public uint netId => netIdentity.netId;
Expand Down