From 2167a6eabe20e9f9c51f780cdccb83b7591fc328 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Wed, 8 Jul 2020 13:58:26 +0800 Subject: [PATCH] Fix compressMap bug --- libs/maps.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/maps.js b/libs/maps.js index 07173f44..900f12e6 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -358,10 +358,8 @@ maps.prototype.saveMap = function (floorId) { var map = maps[floorId]; var thisFloor = this._compressFloorData(map, core.floors[floorId]); - if (map.blocks) { - var mapArr = this.compressMap(this._getMapArrayFromBlocks(map.blocks, map.width, map.height, true), floorId); - if (mapArr != null) thisFloor.map = mapArr; - } + var mapArr = this.compressMap(map.blocks ? this._getMapArrayFromBlocks(map.blocks, map.width, map.height, true) : map.map, floorId); + if (mapArr != null) thisFloor.map = mapArr; return thisFloor; }