Neat idea from Gareth: if you put a % on the end of the mine count

in the Custom dialog box, it'll treat it as a mine density.

[originally from svn r5861]
This commit is contained in:
Simon Tatham
2005-05-30 12:24:31 +00:00
parent 6e7421a3ba
commit 7ff09fbba1
2 changed files with 13 additions and 1 deletions

View File

@ -232,6 +232,8 @@ static game_params *custom_params(config_item *cfg)
ret->w = atoi(cfg[0].sval);
ret->h = atoi(cfg[1].sval);
ret->n = atoi(cfg[2].sval);
if (strchr(cfg[2].sval, '%'))
ret->n = ret->n * (ret->w * ret->h) / 100;
ret->unique = cfg[3].ival;
return ret;