Skip to content

Loading a story state doesn't rollback the error stack #29

@paulloz

Description

@paulloz

Hey 😄

Let's consider the following code.

var state = self.story.state.to_json()
# any action resulting in an error being stacked for interruption 
self.story.state.load_json(state)
if self.story.can_continue:
    self.story.continue()

The expected behavior would be for everything after the new state is loaded to go on smoothly. But at the moment, story execution will stop when continue() is called and the stacked error will be displayed. The error stack needs to be cleared out and InkRuntime.should_interrupt should be reset.

The tricky part would be to determine if some errors are from before the state was saved or not.
E.g.

var state1 = self.story.state.to_json()
# any action resulting in an error being stacked for interruption 
var state2 = self.story.state.to_json()
# any action resulting in an error being stacked for interruption 
self.story.state.load_json(state1|state2)

Depending on which state (state1 or state2) is loaded on the last line, the rollback should probably not be the same.


Environment:

  • OS: Windows 10 Pro
  • Godot version: v3.2.3
  • inkgd version: 96b743b

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions