@@ -54789,10 +54789,7 @@ function addTilePositionAnimation(sprite, dx, dy) {
5478954789 }, {
5479054790 fill: '#fff'
5479154791 });
54792- if (terrainObjects.wallMask.texture !== Texture.EMPTY) {
54793- terrainObjects.wallMask.texture.destroy(true);
54794- }
54795- terrainObjects.wallMask.texture = mask.texture;
54792+ var previousMaskTexture = terrainObjects.wallMask.texture !== Texture.EMPTY ? terrainObjects.wallMask.texture : null;
5479654793 actionHelper.onTextureLoaded(mask.texture, function () {
5479754794 if (lighting !== 'disabled') {
5479854795 var bump = new TilingSprite(Assets.get('noise1'), VIEW_BOX, VIEW_BOX);
@@ -54808,14 +54805,21 @@ function addTilePositionAnimation(sprite, dx, dy) {
5480854805 });
5480954806 bump.destroy();
5481054807 }
54808+ terrainObjects.wallMask.texture = mask.texture;
5481154809 mask.destroy();
5481254810 var _wallObjects = wallObjects;
5481354811 var _wallObjects2 = terrain_slicedToArray(_wallObjects, 1);
5481454812 wallObjects[1].texture = _wallObjects2[0];
5481554813 wallObjects[1].visible = true;
54814+ if (wallObjectsToDestroy[0]) {
54815+ wallObjectsToDestroy[0].destroy(true);
54816+ }
5481654817 if (wallObjectsToDestroy[1]) {
5481754818 wallObjectsToDestroy[1].destroy(true);
5481854819 }
54820+ if (previousMaskTexture && previousMaskTexture !== mask.texture) {
54821+ previousMaskTexture.destroy(true);
54822+ }
5481954823 });
5482054824 wallObjects[2] = RenderTexture.create({
5482154825 width: size.width,
@@ -54844,6 +54848,9 @@ function addTilePositionAnimation(sprite, dx, dy) {
5484454848 var _wallObjects4 = terrain_slicedToArray(_wallObjects3, 3);
5484554849 wallObjects[3].texture = _wallObjects4[2];
5484654850 wallObjects[3].visible = true;
54851+ if (wallObjectsToDestroy[2]) {
54852+ wallObjectsToDestroy[2].destroy(true);
54853+ }
5484754854 if (wallObjectsToDestroy[3]) {
5484854855 wallObjectsToDestroy[3].destroy(true);
5484954856 }
@@ -55810,18 +55817,21 @@ var World = /*#__PURE__*/function () {
5581055817 var _ref2 = World_slicedToArray(_ref, 2),
5581155818 objectMetadata = _ref2[1];
5581255819 if (objectMetadata) {
55813- var _objectMetadata$actio = objectMetadata.actions,
55814- actions = _objectMetadata$actio === void 0 ? [] : _objectMetadata$actio,
55815- _objectMetadata$calcu = objectMetadata.calculations,
55816- calculations = _objectMetadata$calcu === void 0 ? [] : _objectMetadata$calcu,
55817- _objectMetadata$data = objectMetadata.data,
55818- data = _objectMetadata$data === void 0 ? [] : _objectMetadata$data,
55819- _objectMetadata$proce = objectMetadata.processors,
55820- processors = _objectMetadata$proce === void 0 ? [] : _objectMetadata$proce;
55821- objectMetadata.actions = [].concat(World_toConsumableArray(allActions), World_toConsumableArray(actions));
55822- objectMetadata.data = World_objectSpread(World_objectSpread({}, allData), data);
55823- objectMetadata.calculations = [].concat(World_toConsumableArray(allCalculations), World_toConsumableArray(calculations));
55824- objectMetadata.processors = [].concat(World_toConsumableArray(allProcessors), World_toConsumableArray(processors));
55820+ if (!objectMetadata._initialized) {
55821+ var _objectMetadata$actio = objectMetadata.actions,
55822+ actions = _objectMetadata$actio === void 0 ? [] : _objectMetadata$actio,
55823+ _objectMetadata$calcu = objectMetadata.calculations,
55824+ calculations = _objectMetadata$calcu === void 0 ? [] : _objectMetadata$calcu,
55825+ _objectMetadata$data = objectMetadata.data,
55826+ data = _objectMetadata$data === void 0 ? [] : _objectMetadata$data,
55827+ _objectMetadata$proce = objectMetadata.processors,
55828+ processors = _objectMetadata$proce === void 0 ? [] : _objectMetadata$proce;
55829+ objectMetadata.actions = [].concat(World_toConsumableArray(allActions), World_toConsumableArray(actions));
55830+ objectMetadata.data = World_objectSpread(World_objectSpread({}, allData), data);
55831+ objectMetadata.calculations = [].concat(World_toConsumableArray(allCalculations), World_toConsumableArray(calculations));
55832+ objectMetadata.processors = [].concat(World_toConsumableArray(allProcessors), World_toConsumableArray(processors));
55833+ objectMetadata._initialized = true;
55834+ }
5582555835 }
5582655836 });
5582755837
@@ -56006,6 +56016,7 @@ var World = /*#__PURE__*/function () {
5600656016 key: "release",
5600756017 value: function release() {
5600856018 Assets.reset();
56019+ this.removeAllObjects();
5600956020 }
5601056021 }, {
5601156022 key: "getResource",
0 commit comments