Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/webgal/src/Core/controller/gamePlay/scriptExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ export const whenChecker = (whenValue: string | undefined): boolean => {
return !!strIf(valExp);
};

function settleFastPreviewPendingStateBeforeNext() {
if (!WebGAL.gameplay.isFastPreview) {
return;
}

// fast preview 的 -next 链不会在语句之间 commit,需要先结算当前句会影响后续演算的 pending 终态。
WebGAL.gameplay.performController.discardUncommittedNonHoldPerforms(true);
WebGAL.gameplay.performController.clearNonHoldPerformsFromStageState();
}

/**
* 语句执行器
* 执行语句,同步场景状态,并根据情况立即执行下一句或者加入backlog
Expand Down Expand Up @@ -148,6 +158,7 @@ export const scriptExecutor = (depth = 0) => {
if (isNext && !hasPendingBlockingStateCalculationPerform && !WebGAL.sceneManager.lockSceneWrite) {
WebGAL.sceneManager.sceneData.currentSentenceId++;
saveBacklogIfNeeded();
settleFastPreviewPendingStateBeforeNext();
Comment thread
A-kirami marked this conversation as resolved.
Outdated
scriptExecutor(depth + 1);
return;
}
Expand Down
Loading