Skip to content

Commit 437b645

Browse files
committed
[Breaking] isOwner not returns true even if its a player object
1 parent ad9e7bd commit 437b645

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

MLAPI/MonoBehaviours/Core/NetworkedBehaviour.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ public abstract class NetworkedBehaviour : MonoBehaviour
2020
/// </summary>
2121
public bool isLocalPlayer => networkedObject.isLocalPlayer;
2222
/// <summary>
23-
/// Gets if the object is owned by the local player
23+
/// Gets if the object is owned by the local player or if the object is the local player object
2424
/// </summary>
2525
public bool isOwner => networkedObject.isOwner;
2626
/// <summary>
27+
/// Gets if the object is owned by the local player and this is not a player object
28+
/// </summary>
29+
public bool isObjectOwner => networkedObject.isObjectOwner;
30+
/// <summary>
2731
/// Gets if we are executing as server
2832
/// </summary>
2933
protected bool isServer => NetworkingManager.singleton.isServer;

MLAPI/MonoBehaviours/Core/NetworkedObject.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,13 @@ internal set
6868
/// </summary>
6969
public bool isLocalPlayer => isPlayerObject && (OwnerClientId == NetworkingManager.singleton.LocalClientId || (OwnerClientId == NetworkingManager.singleton.NetworkConfig.NetworkTransport.HostDummyId && NetworkingManager.singleton.isHost));
7070
/// <summary>
71-
/// Gets if the object is owned by the local player
71+
/// Gets if the object is owned by the local player or if the object is the local player object
7272
/// </summary>
73-
public bool isOwner => !isPlayerObject && (OwnerClientId == NetworkingManager.singleton.LocalClientId || (OwnerClientId == NetworkingManager.singleton.NetworkConfig.NetworkTransport.HostDummyId && NetworkingManager.singleton.isHost));
73+
public bool isOwner => isLocalPlayer || isObjectOwner;
74+
/// <summary>
75+
/// Gets if the object is owned by the local player and this is not a player object
76+
/// </summary>
77+
public bool isObjectOwner => !isPlayerObject && (OwnerClientId == NetworkingManager.singleton.LocalClientId || (OwnerClientId == NetworkingManager.singleton.NetworkConfig.NetworkTransport.HostDummyId && NetworkingManager.singleton.isHost));
7478
/// <summary>
7579
/// Gets wheter or not the object is owned by anyone
7680
/// </summary>

0 commit comments

Comments
 (0)