@screeps/renderer 1.6.3-arena → 1.6.5-arena

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/dist/renderer.js CHANGED
@@ -54789,10 +54789,7 @@ function addTilePositionAnimation(sprite, dx, dy) {
54789
54789
  }, {
54790
54790
  fill: '#fff'
54791
54791
  });
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;
54796
54793
  actionHelper.onTextureLoaded(mask.texture, function () {
54797
54794
  if (lighting !== 'disabled') {
54798
54795
  var bump = new TilingSprite(Assets.get('noise1'), VIEW_BOX, VIEW_BOX);
@@ -54808,14 +54805,21 @@ function addTilePositionAnimation(sprite, dx, dy) {
54808
54805
  });
54809
54806
  bump.destroy();
54810
54807
  }
54808
+ terrainObjects.wallMask.texture = mask.texture;
54811
54809
  mask.destroy();
54812
54810
  var _wallObjects = wallObjects;
54813
54811
  var _wallObjects2 = terrain_slicedToArray(_wallObjects, 1);
54814
54812
  wallObjects[1].texture = _wallObjects2[0];
54815
54813
  wallObjects[1].visible = true;
54814
+ if (wallObjectsToDestroy[0]) {
54815
+ wallObjectsToDestroy[0].destroy(true);
54816
+ }
54816
54817
  if (wallObjectsToDestroy[1]) {
54817
54818
  wallObjectsToDestroy[1].destroy(true);
54818
54819
  }
54820
+ if (previousMaskTexture && previousMaskTexture !== mask.texture) {
54821
+ previousMaskTexture.destroy(true);
54822
+ }
54819
54823
  });
54820
54824
  wallObjects[2] = RenderTexture.create({
54821
54825
  width: size.width,
@@ -54844,6 +54848,9 @@ function addTilePositionAnimation(sprite, dx, dy) {
54844
54848
  var _wallObjects4 = terrain_slicedToArray(_wallObjects3, 3);
54845
54849
  wallObjects[3].texture = _wallObjects4[2];
54846
54850
  wallObjects[3].visible = true;
54851
+ if (wallObjectsToDestroy[2]) {
54852
+ wallObjectsToDestroy[2].destroy(true);
54853
+ }
54847
54854
  if (wallObjectsToDestroy[3]) {
54848
54855
  wallObjectsToDestroy[3].destroy(true);
54849
54856
  }
@@ -55810,18 +55817,21 @@ var World = /*#__PURE__*/function () {
55810
55817
  var _ref2 = World_slicedToArray(_ref, 2),
55811
55818
  objectMetadata = _ref2[1];
55812
55819
  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
+ }
55825
55835
  }
55826
55836
  });
55827
55837
 
@@ -56006,6 +56016,7 @@ var World = /*#__PURE__*/function () {
56006
56016
  key: "release",
56007
56017
  value: function release() {
56008
56018
  Assets.reset();
56019
+ this.removeAllObjects();
56009
56020
  }
56010
56021
  }, {
56011
56022
  key: "getResource",