mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: #3529 NPC SyncDirection 'authority' now evaluates to true on the server/host
This commit is contained in:
parent
020c514f9a
commit
9bfcd1c110
@ -85,9 +85,12 @@ public abstract class NetworkBehaviour : MonoBehaviour
|
|||||||
// also note that this is a per-NetworkBehaviour flag.
|
// also note that this is a per-NetworkBehaviour flag.
|
||||||
// another component may not be client authoritative, etc.
|
// another component may not be client authoritative, etc.
|
||||||
public bool authority =>
|
public bool authority =>
|
||||||
isClient
|
// check isServer instead of isClient, which covers host mode too.
|
||||||
? syncDirection == SyncDirection.ClientToServer && isOwned
|
// otherwise host mode would only have authority if ClientToServer.
|
||||||
: syncDirection == SyncDirection.ServerToClient;
|
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3529
|
||||||
|
isServer
|
||||||
|
? syncDirection == SyncDirection.ServerToClient
|
||||||
|
: syncDirection == SyncDirection.ClientToServer && isOwned;
|
||||||
|
|
||||||
/// <summary>The unique network Id of this object (unique at runtime).</summary>
|
/// <summary>The unique network Id of this object (unique at runtime).</summary>
|
||||||
public uint netId => netIdentity.netId;
|
public uint netId => netIdentity.netId;
|
||||||
|
Loading…
Reference in New Issue
Block a user