@colyseus/schema 3.0.47 → 3.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2799,6 +2799,12 @@ class MapSchema {
2799
2799
  this.$indexes.delete(index);
2800
2800
  }
2801
2801
  [$onEncodeEnd]() {
2802
+ const changeTree = this[$changes];
2803
+ // cleanup changeTree.indexes of deleted keys
2804
+ for (const indexStr in this.deletedItems) {
2805
+ const key = this.$indexes.get(parseInt(indexStr));
2806
+ delete changeTree.indexes[key];
2807
+ }
2802
2808
  this.deletedItems = {};
2803
2809
  }
2804
2810
  toJSON() {