mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-17 18:40:33 +00:00
fix: #3528 NPC 'isOwned' / 'hasAuthority' now evaluate to true on the server/host
This commit is contained in:
parent
020c514f9a
commit
532e3e860c
@ -1399,6 +1399,11 @@ static void SpawnObject(GameObject obj, NetworkConnection ownerConnection)
|
||||
if (ownerConnection is LocalConnectionToClient)
|
||||
identity.isOwned = true;
|
||||
|
||||
// NPCs (objects without an owner connection) are owned by the server.
|
||||
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3528
|
||||
if (ownerConnection == null)
|
||||
identity.isOwned = true;
|
||||
|
||||
// only call OnStartServer if not spawned yet.
|
||||
// check used to be in NetworkIdentity. may not be necessary anymore.
|
||||
if (!identity.isServer && identity.netId == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user