Skip to content

Commit ba045bc

Browse files
committed
fix: workaround when server encodes ADD + DELETE in the same MapSchema key.
1 parent 4e3fff5 commit ba045bc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Assets/Plugins/Colyseus/Serializer/Schema/Types/MapSchema.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ public object GetByIndex(int index)
5858
public void DeleteByIndex(int index)
5959
{
6060
string dynamicIndex = (string) GetIndex(index);
61-
if (Items.Contains(dynamicIndex))
61+
if (
62+
//
63+
// FIXME:
64+
// The schema encoder should not encode a DELETE operation when using ADD + DELETE in the same key. (in the same patch)
65+
//
66+
dynamicIndex != null &&
67+
Items.Contains(dynamicIndex)
68+
)
6269
{
6370
Items.Remove(dynamicIndex);
6471
Indexes.Remove(index);

0 commit comments

Comments
 (0)