Skip to content

Commit c63b223

Browse files
committed
fix: missing value on NetworkListEvent for EventType.RemoveAt events server side (#2542)
1 parent dfd08d8 commit c63b223

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
1717
- Fixed issue where a client could throw an exception if abruptly disconnected from a network session with one or more spawned `NetworkObject`(s). (#2510)
1818
- Fixed issue where invalid endpoint addresses were not being detected and returning false from NGO UnityTransport. (#2496)
1919
- Fixed some errors that could occur if a connection is lost and the loss is detected when attempting to write to the socket. (#2495)
20+
- Fixed missing value on `NetworkListEvent` for `EventType.RemoveAt` events server side. (#2542)
2021

2122
## Changed
2223

com.unity.netcode.gameobjects/Runtime/NetworkVariable/Collections/NetworkList.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,14 @@ public void RemoveAt(int index)
490490
throw new InvalidOperationException("Client is not allowed to write to this NetworkList");
491491
}
492492

493+
var value = m_List[index];
493494
m_List.RemoveAt(index);
494495

495496
var listEvent = new NetworkListEvent<T>()
496497
{
497498
Type = NetworkListEvent<T>.EventType.RemoveAt,
498-
Index = index
499+
Index = index,
500+
Value = value
499501
};
500502

501503
HandleAddListEvent(listEvent);

0 commit comments

Comments
 (0)