When a story is loaded from JSON, it currently does not convert the action IDs to ints. It looks like Kobold prevents this from causing issues by refreshing the page, but in Ghostpad I've noticed catastrophic bugs resulting from it.
First a story is loaded and string-based IDs get loaded in state
Then as the story is edited, it (correctly) stores those changes using int based IDs
And that's where things get very broken.
This PR makes two small changes to load_json:
Store the int based action id in a variable called action_id so we don't have to cast it 4+ times
Use the int based action id in the data that gets sent to process_variable_changes
I could work around this on the frontend, but I think it makes more sense to have consistent types being sent over the socket
When a story is loaded from JSON, it currently does not convert the action IDs to ints. It looks like Kobold prevents this from causing issues by refreshing the page, but in Ghostpad I've noticed catastrophic bugs resulting from it.
First a story is loaded and string-based IDs get loaded in state
Then as the story is edited, it (correctly) stores those changes using int based IDs
And that's where things get very broken.
This PR makes two small changes to
load_json
:action_id
so we don't have to cast it 4+ timesprocess_variable_changes
I could work around this on the frontend, but I think it makes more sense to have consistent types being sent over the socket