chiark / gitweb /
Gary Wong observes that solo's decode_params() is overenthusiastic
authorSimon Tatham <anakin@pobox.com>
Sun, 11 Mar 2007 10:12:45 +0000 (10:12 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 11 Mar 2007 10:12:45 +0000 (10:12 +0000)
about eating the letter `d' (for `diagonal') when it appears in a
symmtery description: it should only be used after `m', because
mirror symmetry is the only type that can be diagonal. This was
causing parsing of the parameter description `3x3adu' to produce the
wrong answer: the d would be swallowed, then the u ignored for being
incomprehensible, and you'd get default Trivial difficulty.

[originally from svn r7386]

solo.c

diff --git a/solo.c b/solo.c
index c02e750b7b43ef3d00817cc306523a903e593977..bba2cbd15398a7fe0b8a9dc77f13863c6f77ab23 100644 (file)
--- a/solo.c
+++ b/solo.c
@@ -207,7 +207,7 @@ static void decode_params(game_params *ret, char const *string)
         if (*string == 'r' || *string == 'm' || *string == 'a') {
             int sn, sc, sd;
             sc = *string++;
-            if (*string == 'd') {
+            if (sc == 'm' && *string == 'd') {
                 sd = TRUE;
                 string++;
             } else {