From 7ff09fbba196e540a60a866c9a7c208b5edacfd8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 30 May 2005 12:24:31 +0000 Subject: 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] --- mines.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mines.c') diff --git a/mines.c b/mines.c index 3c06b53..db98cc9 100644 --- a/mines.c +++ b/mines.c @@ -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; -- cgit v1.1