ink
ink copied to clipboard
Force refresh of List origins when accessed via VariablesState to fix bug where some Lists loaded from file don't get initialized.
This is my (hacky?) fix for the bug I describe here: https://github.com/inkle/ink/issues/763
This PR adds a check when an InkList
is accessed via VariablesState
to see if its origins
is null. If it is, then it tries to populate them at that point. The rest of the changes are some code refactoring to keep the origin-setting code in one place.
This has fixed my specific problem, but it's almost certainly not a comprehensive fix. Hopefully it's a useful start though.
The real fix should probably make sure all InkList
origins
are populated after a LoadJson()
. I don't understand the entire runtime enough to do that.