From 9be7db547aa2eba68492dc3326ea36ebeeb63505 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 13 Feb 2023 23:22:59 +0000 Subject: Add a game_state argument to decode_ui() Some games would like a way to check that the parameters in the encoded UI string are consistent with the game parameters. Since this might depend on the current state of the game (this being what changed_state() is for), implement this by adding a game_state parameter to decode_ui(). Nothing currently uses it, though Guess usefully could. --- guess.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guess.c') diff --git a/guess.c b/guess.c index 1dbea4c..dc02d57 100644 --- a/guess.c +++ b/guess.c @@ -452,7 +452,8 @@ static char *encode_ui(const game_ui *ui) return sresize(ret, p - ret, char); } -static void decode_ui(game_ui *ui, const char *encoding) +static void decode_ui(game_ui *ui, const char *encoding, + const game_state *state) { int i; const char *p = encoding; -- cgit v1.1