diff --git a/src/core/render/item.ts b/src/core/render/item.ts index b1cccc8..a50af96 100644 --- a/src/core/render/item.ts +++ b/src/core/render/item.ts @@ -405,6 +405,7 @@ export abstract class RenderItem this.remove(); this.emit('destroy'); this.removeAllListeners(); + RenderItem.itemMap.delete(this._id); } } diff --git a/src/plugin/game/fallback.ts b/src/plugin/game/fallback.ts index 40a9e92..e34776c 100644 --- a/src/plugin/game/fallback.ts +++ b/src/plugin/game/fallback.ts @@ -620,35 +620,6 @@ export function init() { callback?.(); }, animateTime + 50); - // time /= Math.max(core.status.replay.speed, 1); - // var per_time = 10, - // step = 0, - // steps = parseInt(time / per_time); - // if (steps <= 0) { - // this.setViewport(32 * x, 32 * y); - // if (callback) callback(); - // return; - // } - // var px = core.clamp(32 * x, 0, 32 * core.bigmap.width - core._PX_); - // var py = core.clamp(32 * y, 0, 32 * core.bigmap.height - core._PY_); - // var cx = core.bigmap.offsetX; - // var cy = core.bigmap.offsetY; - // var moveFunc = core.applyEasing(moveMode); - - // var animate = window.setInterval(function () { - // step++; - // core.setViewport( - // cx + moveFunc(step / steps) * (px - cx), - // cy + moveFunc(step / steps) * (py - cy) - // ); - // if (step == steps) { - // delete core.animateFrame.asyncId[animate]; - // clearInterval(animate); - // core.setViewport(px, py); - // if (callback) callback(); - // } - // }, per_time); - const id = fallbackIds++; core.animateFrame.lastAsyncId = id; core.animateFrame.asyncId[id] = () => {