Skip to content

Commit

Permalink
fix: triggers & dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
siriuslatte committed Feb 27, 2023
1 parent 6bb6536 commit bbb5136
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/ast-interpreter/visitor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export class ScribeVisitor implements Interpreter {
}

this.records.stores[ref][0] = refValue;
this.callbacks.storeChange({ identifier: ref, data: refValue, metadata: metadata as never });
this.callbacks.storeChange?.({ identifier: ref, data: refValue, metadata: metadata as never });
this.tracker.event.notify(ref);
}

Expand Down Expand Up @@ -414,7 +414,7 @@ export class ScribeVisitor implements Interpreter {
}

task.spawn(() => {
this.callbacks.dialog({
this.callbacks.dialog?.({
characterIdentifier,
text,
metadata,
Expand All @@ -424,8 +424,6 @@ export class ScribeVisitor implements Interpreter {
this.resolve(options[id - 1]._body);
}

print("Wtf");

return coroutine.resume(this.interpreterCoroutine);
},
});
Expand Down
1 change: 0 additions & 1 deletion src/vm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class ScribeVM {
switch ((instruction = this.read_byte())) {
case OpCode.OP_CONSTANT: {
const constant: Value = this.read_constant();
print(constant);

break;
}
Expand Down

0 comments on commit bbb5136

Please sign in to comment.