From 0770aa3201c10414acc04a30e36346bcc7f163ae Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sat, 30 May 2020 19:25:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DsetBlock=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/maps.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/libs/maps.js b/libs/maps.js index a7ac82f7..e3541890 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -1618,16 +1618,6 @@ maps.prototype.setBlock = function (number, x, y, floorId) { } var originBlock = core.getBlock(x, y, floorId, true); var originEvent = originBlock == null ? null : originBlock.block.event; - if (floorId == core.status.floorId) { - - core.removeGlobalAnimate(x, y); - core.clearMap('event', x * 32, y * 32, 32, 32); - if (originBlock != null) { - var height = (originBlock.block.event || {}).height || 32; - if (height > 32) - core.clearMap('event2', x * 32, y * 32 + 32 - height, 32, height - 32); - } - } if (originBlock == null) { core.status.maps[floorId].blocks.push(block); } @@ -1642,15 +1632,14 @@ maps.prototype.setBlock = function (number, x, y, floorId) { core.drawMap(); } else { if (originEvent != null) { - this._removeBlockFromMap(floorId, {event: originEvent}); + this._removeBlockFromMap(floorId, {x: x, y: y, event: originEvent}); } if (!block.disable) { core.drawBlock(block); + core.addGlobalAnimate(block); + core.updateStatusBar(); } } - if (originEvent != null) { - this._removeBlockFromMap() - } } }