diff --git a/Assets/Plugins/Colyseus/Serializer/Schema/Types/MapSchema.cs b/Assets/Plugins/Colyseus/Serializer/Schema/Types/MapSchema.cs index 0ab72fd6..2ec90d97 100644 --- a/Assets/Plugins/Colyseus/Serializer/Schema/Types/MapSchema.cs +++ b/Assets/Plugins/Colyseus/Serializer/Schema/Types/MapSchema.cs @@ -58,7 +58,14 @@ public object GetByIndex(int index) public void DeleteByIndex(int index) { string dynamicIndex = (string) GetIndex(index); - if (Items.Contains(dynamicIndex)) + if ( + // + // FIXME: + // The schema encoder should not encode a DELETE operation when using ADD + DELETE in the same key. (in the same patch) + // + dynamicIndex != null && + Items.Contains(dynamicIndex) + ) { Items.Remove(dynamicIndex); Indexes.Remove(index);