Closed DeeJayLSP closed 2 years ago
If the save file is stored as a binary .res instead of a text .tres, file.get_as_text() will fail and a broken temporary file will be generated.
file.get_as_text()
Reading and storing as a byte array works with both text resources and binary resources.
Please check if the PR fulfills these requirements:
What kind of change does this PR introduce?
It changes the workaround in the load_savegame() function. Instead of reading the file as text, it reads as a byte array.
load_savegame()
Does this PR introduce a breaking change?
It only changes the way the temporary save file is read and stored, so no.
What is the current behavior?
Read save file as string, temporarily store it as string.
What is the new behavior?
Read save file as binary, temporarily store it as binary.
Other information:
Since a whole text file is copied and stored as a binary, it will still work as an usual text file.
Thank you very much for the contribution, and please excuse the review delay. I had lost track of the PR. Don't hesitate to ping us if we're that slow to review and merge again in the future.
If the save file is stored as a binary .res instead of a text .tres,
file.get_as_text()
will fail and a broken temporary file will be generated.Reading and storing as a byte array works with both text resources and binary resources.
Please check if the PR fulfills these requirements:
What kind of change does this PR introduce?
It changes the workaround in the
load_savegame()
function. Instead of reading the file as text, it reads as a byte array.Does this PR introduce a breaking change?
It only changes the way the temporary save file is read and stored, so no.
New feature or change
What is the current behavior?
Read save file as string, temporarily store it as string.
What is the new behavior?
Read save file as binary, temporarily store it as binary.
Other information:
Since a whole text file is copied and stored as a binary, it will still work as an usual text file.