diff -u -r tworld-1.2.1/solution.c tworld-1.2.1-ruleswitch/solution.c --- tworld-1.2.1/solution.c 2004-10-13 13:39:32.000000000 +0100 +++ tworld-1.2.1-ruleswitch/solution.c 2005-12-30 14:51:12.000000000 +0000 @@ -425,7 +425,7 @@ /* Locate the solution file for the given data file and open it. */ -static int opensolutionfile(fileinfo *file, char const *datname, int readonly) +static int opensolutionfile(fileinfo *file, char const *datname, int ruleset, int readonly) { char *buf = NULL; char const *filename; @@ -439,9 +439,12 @@ && tolower(datname[n - 2]) == 'a' && tolower(datname[n - 1]) == 't') n -= 4; - xalloc(buf, n + 5); + xalloc(buf, n + 7); memcpy(buf, datname, n); - memcpy(buf + n, ".tws", 5); + memcpy(buf + n, "-m.tws", 7); + /* Add ruleset specifier */ + if(ruleset == Ruleset_Lynx) + buf[n + 1] = 'l'; filename = buf; } n = openfileindir(file, savedir, filename, @@ -462,8 +465,8 @@ int i, j; if (!savedir || !*savedir - || !opensolutionfile(&series->solutionfile, - series->filebase, TRUE)) { + || !opensolutionfile(&series->solutionfile, series->filebase, + series->ruleset, TRUE)) { series->solutionflags = series->ruleset; return TRUE; } @@ -530,8 +533,8 @@ } if (series->solutionfile.fp) fileclose(&series->solutionfile, NULL); - if (!opensolutionfile(&series->solutionfile, - series->filebase, FALSE)) { + if (!opensolutionfile(&series->solutionfile, series->filebase, + series->ruleset, FALSE)) { *savedir = '\0'; return FALSE; } diff -u -r tworld-1.2.1/tworld.c tworld-1.2.1-ruleswitch/tworld.c --- tworld-1.2.1/tworld.c 2004-10-21 20:25:20.000000000 +0100 +++ tworld-1.2.1-ruleswitch/tworld.c 2005-12-30 14:51:12.000000000 +0000 @@ -303,6 +303,8 @@ case CmdProceed: *move = CmdProceed; return FALSE; case CmdQuitLevel: *move = CmdQuitLevel; return FALSE; case CmdHelp: *move = CmdHelp; return FALSE; + case CmdEast: *move = CmdEast; return FALSE; + case CmdWest: *move = CmdWest; return FALSE; case CmdQuit: exit(0); } @@ -1027,6 +1029,16 @@ pushsubtitle("Help"); onlinefirsthelp(); popsubtitle(); + } else if (f == CmdEast) { + getseriesfromlist(&gs->series, series->list, n); + gs->series.ruleset = Ruleset_Lynx; + okay = TRUE; + break; + } else if (f == CmdWest) { + getseriesfromlist(&gs->series, series->list, n); + gs->series.ruleset = Ruleset_MS; + okay = TRUE; + break; } } }