From a2b4376782efb41f2a79fca9128fe9aba298a7d8 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Fri, 13 Aug 2021 23:52:10 +0800 Subject: [PATCH] Fix 281 bugs --- _server/MotaAction.g4 | 4 ++-- _server/MotaActionParser.js | 2 +- libs/events.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/_server/MotaAction.g4 b/_server/MotaAction.g4 index ba815cbc..9bf03a18 100644 --- a/_server/MotaAction.g4 +++ b/_server/MotaAction.g4 @@ -3058,7 +3058,7 @@ return ''; waitAsync_s - : '等待所有异步事件执行完毕' '不等待动画' Bool '不等待音效' Bool + : '等待所有异步事件执行完毕' '不等待动画' Bool '等待音效' Bool /* waitAsync_s @@ -3067,7 +3067,7 @@ helpUrl : /_docs/#/instruction default : [false, false] colour : this.soundColor Bool_0 = Bool_0 ? ', "excludeAnimates": true' : ''; -Bool_1 = Bool_1 ? ', "excludeSounds": true' : ''; +Bool_1 = Bool_1 ? ', "includeSounds": true' : ''; var code = '{"type": "waitAsync"'+Bool_0+Bool_1+'},\n'; return code; */; diff --git a/_server/MotaActionParser.js b/_server/MotaActionParser.js index 32604894..6ba25fe5 100644 --- a/_server/MotaActionParser.js +++ b/_server/MotaActionParser.js @@ -969,7 +969,7 @@ ActionParser.prototype.parseAction = function() { break; case "waitAsync": // 等待所有异步事件执行完毕 this.next = MotaActionBlocks['waitAsync_s'].xmlText([ - data.excludeAnimates||false, data.excludeSounds||false, this.next]); + data.excludeAnimates||false, data.includeSounds||false, this.next]); break; case "callBook": // 呼出怪物手册 this.next = MotaActionBlocks['callBook_s'].xmlText([ diff --git a/libs/events.js b/libs/events.js index 3c16c31a..2449a4a2 100644 --- a/libs/events.js +++ b/libs/events.js @@ -510,7 +510,7 @@ events.prototype.openDoor = function (x, y, needKey, callback) { core.removeBlock(x, y); setTimeout(function () { core.status.replay.animate = false; - core.events.afterOpenDoor(id, x, y); + core.events.afterOpenDoor(block.event.id, x, y); if (callback) callback(); }, 1); // +1是为了录像检测系统 } else { @@ -2495,8 +2495,8 @@ events.prototype._precompile_wait = function (data) { events.prototype._action_waitAsync = function (data, x, y, prefix) { var test = window.setInterval(function () { if (!core.hasAsync() - && (data.excludeAnimates || core.getAnimates().length == 0) - && (data.excludeSounds || core.getSounds().length == 0)) { + && (data.excludeAnimates || core.isReplaying() || core.getAnimates().length == 0) + && (!data.includeSounds || core.isReplaying() || core.getSounds().length == 0)) { clearInterval(test); core.doAction(); }