fix: #3329 NetworkTransform UpdateServer checks if .connectionToClient is null to support room demo / scene changes

This commit is contained in:
vis2k 2022-12-31 14:36:57 +01:00
parent 6581300ce0
commit ca9f07d812
2 changed files with 11 additions and 3 deletions

View File

@ -310,7 +310,11 @@ void UpdateServer()
// -> don't apply for host mode player objects either, even if in
// client authority mode. if it doesn't go over the network,
// then we don't need to do anything.
if (syncDirection == SyncDirection.ClientToServer && !isOwned)
// -> connectionToClient is briefly null after scene changes:
// https://github.com/MirrorNetworking/Mirror/issues/3329
if (syncDirection == SyncDirection.ClientToServer &&
connectionToClient != null &&
!isOwned)
{
if (serverSnapshots.Count > 0)
{

View File

@ -232,7 +232,11 @@ void UpdateServer()
// -> don't apply for host mode player objects either, even if in
// client authority mode. if it doesn't go over the network,
// then we don't need to do anything.
if (syncDirection == SyncDirection.ClientToServer && !isOwned)
// -> connectionToClient is briefly null after scene changes:
// https://github.com/MirrorNetworking/Mirror/issues/3329
if (syncDirection == SyncDirection.ClientToServer &&
connectionToClient != null &&
!isOwned)
{
if (serverSnapshots.Count > 0)
{