aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-01-07 23:53:36 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-01-15 16:24:27 +0000
commita45f1830cf4af0fbaf2fad448f717a6458b48b24 (patch)
tree6b8a336b682b3b6ca5404b7080e8259831893be1
parent8c5279cf75e41f1ae75b2daf0d06c883a5ae0bca (diff)
downloadpuzzles-a45f1830cf4af0fbaf2fad448f717a6458b48b24.zip
puzzles-a45f1830cf4af0fbaf2fad448f717a6458b48b24.tar.gz
puzzles-a45f1830cf4af0fbaf2fad448f717a6458b48b24.tar.bz2
puzzles-a45f1830cf4af0fbaf2fad448f717a6458b48b24.tar.xz
Explain what decode_ui() should do with invalid input
It can't signal an error, but it's worth documenting that it can receive invalid input and should do what it can with it. I assume that failing to decode game_ui data from a newer version generally won't be disastrous the way failing to decode a description or move string would be.
-rw-r--r--devel.but5
1 files changed, 4 insertions, 1 deletions
diff --git a/devel.but b/devel.but
index 2402c74..87df788 100644
--- a/devel.but
+++ b/devel.but
@@ -891,7 +891,10 @@ source.)
This function parses a string previously output by \cw{encode_ui()},
and writes the decoded data back into the freshly-created \c{game_ui}
-structure provided.
+structure provided. If the string is invalid, the function should do
+the best it can, which might just mean not changing the \c{game_ui}
+structure at all. This might happen if a save file is corrupted, or
+simply from a newer version that encodes more \c{game_ui} data.
\S{backend-changed-state} \cw{changed_state()}