@colyseus/schema 2.0.19 → 2.0.20
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.
- package/build/cjs/index.js +10 -1
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.mjs +10 -1
- package/build/esm/index.mjs.map +1 -1
- package/build/umd/index.js +10 -1
- package/lib/changes/ReferenceTracker.d.ts +1 -1
- package/lib/changes/ReferenceTracker.js +10 -1
- package/lib/changes/ReferenceTracker.js.map +1 -1
- package/package.json +1 -1
- package/src/changes/ReferenceTracker.ts +12 -2
package/build/cjs/index.js
CHANGED
|
@@ -2288,7 +2288,16 @@ var ReferenceTracker = /** @class */ (function () {
|
|
|
2288
2288
|
};
|
|
2289
2289
|
// for decoding
|
|
2290
2290
|
ReferenceTracker.prototype.removeRef = function (refId) {
|
|
2291
|
-
|
|
2291
|
+
var refCount = this.refCounts[refId];
|
|
2292
|
+
if (refCount === undefined) {
|
|
2293
|
+
console.warn("trying to remove reference ".concat(refId, " that doesn't exist"));
|
|
2294
|
+
return;
|
|
2295
|
+
}
|
|
2296
|
+
if (refCount === 0) {
|
|
2297
|
+
console.warn("trying to remove reference ".concat(refId, " with 0 refCount"));
|
|
2298
|
+
return;
|
|
2299
|
+
}
|
|
2300
|
+
this.refCounts[refId] = refCount - 1;
|
|
2292
2301
|
this.deletedRefs.add(refId);
|
|
2293
2302
|
};
|
|
2294
2303
|
ReferenceTracker.prototype.clearRefs = function () {
|