ink icon indicating copy to clipboard operation
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.

Open russellquinn opened this issue 2 years ago • 0 comments

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.

russellquinn avatar May 13 '22 05:05 russellquinn