Fix moveImage

This commit is contained in:
ckcz123 2019-02-22 18:59:21 +08:00
parent 3e12cfd0b8
commit 5cd2613f78
2 changed files with 4 additions and 3 deletions

View File

@ -1810,7 +1810,7 @@ events.prototype.moveImage = function (code, to, opacityVal, time, callback) {
var animate = setInterval(function () { var animate = setInterval(function () {
step++; step++;
moveStep(); moveStep();
if (step > steps) { if (step == steps) {
if (core.isset(opacityVal)) if (core.isset(opacityVal))
core.setOpacity(name, opacityVal); core.setOpacity(name, opacityVal);
delete core.animateFrame.asyncId[animate]; delete core.animateFrame.asyncId[animate];

View File

@ -208,13 +208,14 @@ maps.prototype.decompressMap = function (mapArr, floorId) {
var mw = core.floors[floorId].width || 13; var mw = core.floors[floorId].width || 13;
var mh = core.floors[floorId].height || 13; var mh = core.floors[floorId].height || 13;
for (var x=0;x<mh;x++) { for (var x=0;x<mh;x++) {
var floorMap = core.floors.map[x] || [];
if (mapArr[x] === 0) { if (mapArr[x] === 0) {
mapArr[x] = core.clone(core.floors[floorId].map[x]); mapArr[x] = floorMap;
} }
else { else {
for (var y=0;y<mw;y++) { for (var y=0;y<mw;y++) {
if (mapArr[x][y] === -1) { if (mapArr[x][y] === -1) {
mapArr[x][y] = core.floors[floorId].map[x][y]; mapArr[x][y] = floorMap[y] || 0;
} }
} }
} }