From f174e3d8d1c4d71f81d470fe1cce89e4b4fc3f13 Mon Sep 17 00:00:00 2001 From: ChessBot-Entry Date: Wed, 19 Feb 2025 16:46:42 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20continueLoop=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/playground/executors.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/playground/executors.js b/src/playground/executors.js index 9a060f401b..621e81017a 100644 --- a/src/playground/executors.js +++ b/src/playground/executors.js @@ -228,11 +228,17 @@ class Executor { if (this._callStack.length) { this.scope = this._callStack.pop(); } - const schema = Entry.block[this.scope.block.type]; - if (schema.class === 'condition') { + else { + return Entry.STATIC.PASS; + } + while (this._callStack.length) { + const schema = Entry.block[this.scope.block.type]; + if (schema.class === 'repeat') { + break; + } this.scope = this._callStack.pop(); } - return Entry.STATIC.BREAK; + return Entry.STATIC.CONTINUE; } end() { From ca58e477b1e24de192641e40c31bdbda19048e34 Mon Sep 17 00:00:00 2001 From: ChessBot-Entry Date: Fri, 21 Feb 2025 23:53:30 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20"=EC=86=8C=EB=A6=AC=20=EC=9E=AC?= =?UTF-8?q?=EC=83=9D=ED=95=98=EA=B3=A0=20=EA=B8=B0=EB=8B=A4=EB=A6=AC?= =?UTF-8?q?=EA=B8=B0"=20=EC=BD=94=EB=93=9C=EC=97=90=EC=84=9C=20=EB=8C=80?= =?UTF-8?q?=EA=B8=B0=20=EC=8B=9C=EA=B0=84=EC=97=90=20=EC=9D=BC=EC=8B=9C?= =?UTF-8?q?=EC=A0=95=EC=A7=80=ED=95=9C=20=EC=8B=9C=EA=B0=84=EC=9D=B4=20?= =?UTF-8?q?=ED=8F=AC=ED=95=A8=EB=90=98=EB=8A=94=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/playground/blocks/block_sound.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/playground/blocks/block_sound.js b/src/playground/blocks/block_sound.js index 57fd60651b..426460826f 100644 --- a/src/playground/blocks/block_sound.js +++ b/src/playground/blocks/block_sound.js @@ -293,12 +293,10 @@ module.exports = { script.playState = 1; const instance = Entry.Utils.playSound(sound.id); Entry.Utils.addSoundInstances(instance, sprite); - const duration = Math.floor( - (sound.duration * 1000) / Entry.playbackRateValue - ); - setTimeout(() => { + + instance.on('complete', () => { script.playState = 0; - }, duration); + }); } return script; } else if (script.playState == 1) { @@ -381,14 +379,13 @@ module.exports = { const sound = sprite.parent.getSound(soundId); if (sound) { script.playState = 1; - const instance = Entry.Utils.playSound(sound.id); + const duration = script.getNumberValue('SECOND', script) * 1000; + const instance = Entry.Utils.playSound(sound.id, { duration }); Entry.Utils.addSoundInstances(instance, sprite); - const timeValue = script.getNumberValue('SECOND', script); - setTimeout(() => { - instance.stop(); + + instance.on('complete', () => { script.playState = 0; - }, timeValue * 1000); - instance.addEventListener('complete', (e) => {}); + }); } return script; } else if (script.playState == 1) { @@ -498,9 +495,9 @@ module.exports = { }); Entry.Utils.addSoundInstances(instance, sprite); - setTimeout(() => { + instance.on('complete', () => { script.playState = 0; - }, duration); + }); } return script; } else if (script.playState == 1) { From 97fb6e7c992c57917f3fdffd626ea182fbc60afa Mon Sep 17 00:00:00 2001 From: ChessBot-Entry Date: Sat, 22 Feb 2025 00:01:27 +0900 Subject: [PATCH 3/3] fix: uhhhhh --- src/playground/executors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/playground/executors.js b/src/playground/executors.js index 20cc5a5438..7a40beab89 100644 --- a/src/playground/executors.js +++ b/src/playground/executors.js @@ -235,7 +235,7 @@ class Executor { } this.scope = this._callStack.pop(); } - return Entry.STATIC.CONTINUE; + return Entry.STATIC.BREAK; } end() {