Skip to content

Commit

Permalink
fix: nre modifying syncvars that have not been spawned
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Oct 6, 2020
1 parent 0ab4c60 commit 69883c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Assets/Mirror/Runtime/NetworkBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ protected void SetSyncVar<T>(T value, ref T fieldValue, ulong dirtyBit)
public void SetDirtyBit(ulong dirtyBit)
{
SyncVarDirtyBits |= dirtyBit;
Server.DirtyObjects.Add(NetIdentity);
if (IsServer)
Server.DirtyObjects.Add(NetIdentity);
}

/// <summary>
Expand Down

0 comments on commit 69883c5

Please sign in to comment.