diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-05-30 12:24:31 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-05-30 12:24:31 +0000 |
| commit | 7ff09fbba196e540a60a866c9a7c208b5edacfd8 (patch) | |
| tree | acaa2efe9afeaf37048fcc1cf58001ed2db99962 /mines.c | |
| parent | 6e7421a3ba0318e730e6fafb77e5d60c25edd21a (diff) | |
| download | puzzles-7ff09fbba196e540a60a866c9a7c208b5edacfd8.zip puzzles-7ff09fbba196e540a60a866c9a7c208b5edacfd8.tar.gz puzzles-7ff09fbba196e540a60a866c9a7c208b5edacfd8.tar.bz2 puzzles-7ff09fbba196e540a60a866c9a7c208b5edacfd8.tar.xz | |
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]
Diffstat (limited to 'mines.c')
| -rw-r--r-- | mines.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |