Skip to content

Commit

Permalink
Fixed critial SyncVar issue where array length would be checked befor…
Browse files Browse the repository at this point in the history
…e array was created
  • Loading branch information
TwoTenPvP committed Mar 31, 2018
1 parent a793dc6 commit cf34bc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MLAPI/MonoBehaviours/Core/NetworkedBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,11 @@ internal void SyncVarInit()
}
}
}
if(dirtyFields.Length > 255)
dirtyFields = new bool[syncedFields.Count];
if (dirtyFields.Length > 255)
{
Debug.LogError("MLAPI: You can not have more than 255 SyncVar's per NetworkedBehaviour!");
}
dirtyFields = new bool[syncedFields.Count];
}

internal void OnSyncVarUpdate(object value, byte fieldIndex)
Expand Down

0 comments on commit cf34bc3

Please sign in to comment.