From 2ab0ccb4a91745197404391b10b1658fdcefe0d8 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Wed, 8 Jul 2020 11:35:10 +0800 Subject: [PATCH] Fix replay stackoverflow --- libs/control.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/control.js b/libs/control.js index 119a5f00..a1fc35bd 100644 --- a/libs/control.js +++ b/libs/control.js @@ -1568,7 +1568,9 @@ control.prototype.__replay_getTimeout = function () { control.prototype._replayAction_move = function (action) { if (["up","down","left","right"].indexOf(action)<0) return false; - core.moveHero(action, core.replay); + core.moveHero(action, function () { + setTimeout(core.replay); + }); return true; }