mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: #3343 allow modifying client synclists for unspawned objects like character previews
This commit is contained in:
parent
8570afab94
commit
0d53f7c3a0
@ -247,7 +247,14 @@ protected void InitSyncObject(SyncObject syncObject)
|
||||
|
||||
// client only: only ClientToServer and owned
|
||||
if (NetworkClient.active)
|
||||
return syncDirection == SyncDirection.ClientToServer && isOwned;
|
||||
{
|
||||
// spawned: only ClientToServer and owned
|
||||
if (netId != 0) return syncDirection == SyncDirection.ClientToServer && isOwned;
|
||||
|
||||
// not spawned (character selection previews, etc.): always allow
|
||||
// fixes https://github.com/MirrorNetworking/Mirror/issues/3343
|
||||
return true;
|
||||
}
|
||||
|
||||
// undefined behaviour should throw to make it very obvious
|
||||
throw new Exception("InitSyncObject: IsWritable: neither NetworkServer nor NetworkClient are active.");
|
||||
|
Loading…
Reference in New Issue
Block a user