Description
The fix to prevent duplicate application (#1917) by @jeffreyrainy introduces a bug where when a client gets the spawn call of an object, the server marks dirty the NetworkList's base.IsDirty() causing the NetworkList's next WriteDelta to enter the if sending the EventType.Full which is using the modified WriteField that sends value from m_ListAtLastReset instead of m_List. Since m_ListAtLastReset is empty upon spawning the NetworkList's NetworkObject because no ResetDirty has happened yet, the client will receive an empty list and further EventType.Value will throw by trying to set the value in an empty m_List.
Environment
- OS: Windows 10
- Unity Version: 2020.3.16f1
- Netcode Version: develop branch, commit #24388c4c636544871bfe40d1fccf616751665ade
Description
The fix to prevent duplicate application (#1917) by @jeffreyrainy introduces a bug where when a client gets the spawn call of an object, the server marks dirty the NetworkList's
base.IsDirty()causing the NetworkList's nextWriteDeltato enter theifsending theEventType.Fullwhich is using the modifiedWriteFieldthat sends value fromm_ListAtLastResetinstead ofm_List. Sincem_ListAtLastResetis empty upon spawning the NetworkList's NetworkObject because noResetDirtyhas happened yet, the client will receive an empty list and furtherEventType.Valuewill throw by trying to set the value in an emptym_List.Environment