From bd44c3c0e3e15483ba5652be6073f0f243466c8c Mon Sep 17 00:00:00 2001 From: Shaun Date: Sat, 15 May 2021 16:09:57 +0200 Subject: [PATCH] bug #1777 --- src/client/js/components/chest.js | 13 ++++--------- src/client/js/objects/objects.js | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/client/js/components/chest.js b/src/client/js/components/chest.js index 46b03f4d..38943df7 100644 --- a/src/client/js/components/chest.js +++ b/src/client/js/components/chest.js @@ -3,7 +3,7 @@ define([ ], function ( ) { - let colors = [ + const colors = [ '929398', '80f643', '3fa7dd', @@ -11,7 +11,7 @@ define([ 'ffeb38' ]; - let chances = [ + const chances = [ 0.0075, 0.02, 0.04, @@ -19,7 +19,7 @@ define([ 0.095 ]; - let indices = { + const indices = { 50: 0, 51: 1, 128: 2, @@ -33,12 +33,7 @@ define([ ownerName: null, init: function (blueprint) { - if (this.ownerName && (!window.player || window.player.name !== this.ownerName)) { - this.obj.sheetName = null; - return; - } - - let index = indices[this.obj.cell] || 0; + const index = indices[this.obj.cell] || 0; this.obj.addComponent('particles', { chance: chances[index], diff --git a/src/client/js/objects/objects.js b/src/client/js/objects/objects.js index d4dd54bb..01cce11f 100644 --- a/src/client/js/objects/objects.js +++ b/src/client/js/objects/objects.js @@ -137,7 +137,7 @@ define([ if (obj.sheetName) obj.sprite = renderer.buildObject(obj); - if ((obj.name) && (obj.sprite)) { + if (obj.name && obj.sprite) { obj.nameSprite = renderer.buildText({ layerName: 'effects', text: obj.name,