mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Add a `full' parameter to validate_params(), analogous to the one in
encode_params(). This is necessary for cases where generation-time parameters that are normally omitted from descriptive IDs can place restrictions on other parameters; in particular, when the default value of a relevant generation-time parameter is not the one used to generate the descriptive ID, validation could reject self-generated IDs (e.g., Net `5x2w:56182ae7c2', and some cases in `Pegs'). [originally from svn r6068]
This commit is contained in:
4
net.c
4
net.c
@ -293,7 +293,7 @@ static game_params *custom_params(config_item *cfg)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *validate_params(game_params *params)
|
||||
static char *validate_params(game_params *params, int full)
|
||||
{
|
||||
if (params->width <= 0 || params->height <= 0)
|
||||
return "Width and height must both be greater than zero";
|
||||
@ -347,7 +347,7 @@ static char *validate_params(game_params *params)
|
||||
* is at least 2^(number of such rows), and in particular is at
|
||||
* least 2 since there must be at least one such row. []
|
||||
*/
|
||||
if (params->unique && params->wrapping &&
|
||||
if (full && params->unique && params->wrapping &&
|
||||
(params->width == 2 || params->height == 2))
|
||||
return "No wrapping puzzle with a width or height of 2 can have"
|
||||
" a unique solution";
|
||||
|
Reference in New Issue
Block a user