analyse/gamebook: Fix analyse toggle when out of mainline

pull/9306/head
Benedikt Werner 2021-06-29 13:57:35 +02:00
parent 034c94d68e
commit 366bdccd30
No known key found for this signature in database
GPG Key ID: 1DBFF0F8E9E121EB
1 changed files with 4 additions and 2 deletions

View File

@ -41,8 +41,10 @@ export default class GamebookPlayCtrl {
},
parPath = treePath.init(this.root.path),
parNode = this.root.tree.nodeAtPath(parPath);
if (!this.root.onMainline && !this.root.tree.pathIsMainline(parPath)) return;
if (this.root.onMainline && !node.children[0]) {
if (
(this.root.onMainline && !node.children[0]) ||
(!this.root.onMainline && !this.root.tree.pathIsMainline(parPath))
) {
state.feedback = 'end';
} else if (this.isMyMove()) {
state.feedback = 'play';