From 933a91f9d00f69c4c7c2c2d2a34b977966d6a927 Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 16 Nov 2023 17:51:22 +0800 Subject: [PATCH] feat: genContent may throw the step-like info. --- game/game.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/game/game.js b/game/game.js index 2173066c2..0986cd877 100644 --- a/game/game.js +++ b/game/game.js @@ -11595,12 +11595,16 @@ result:result }); var res=gen.next((lastEvent&&("result" in lastEvent))?lastEvent.result:null); - if(res.done) event.finish(); - else { - var currentResult=res.value; - // TODO: use `event.debugger` to replace source - if(typeof currentResult=="function") yield currentResult; - else lastEvent=currentResult; + if(res.done) return event.finish(); + var currentResult=res.value; + // TODO: use `event.debugger` to replace source + if(typeof currentResult=="function") yield currentResult; + else{ + if(Array.isArray(currentResult)){ + event.step=currentResult[1]; + currentResult=currentResult[0]; + } + lastEvent=currentResult; } } }else if(item._parsed) return item;