Index: commandline.doc ================================================================== --- commandline.doc +++ commandline.doc @@ -73,10 +73,13 @@ -z Load a composite puzzle set. In this case, the should be the full file name of the puzzle, including the suffix. +-+ + Load the level whose ID number is specified by the "level" resource. + === Dot commands === .b0 Disable terminate on errors. Index: config.doc ================================================================== --- config.doc +++ config.doc @@ -87,11 +87,12 @@ .keyRepeat The keyboard repeat rate, which are two numbers, first the key repeating delay and then the key repeating interval. .level - Specifies the 1-based order number of the level to start at. + Specifies the 1-based order number of the level to start at. If the -+ + switch is specified, then it is a 0-based ID number instead. .listColumns Number of columns in the wide mode of the list of levels. If zero or not specified, determines automatically by the screen width. Index: game.c ================================================================== --- game.c +++ game.c @@ -1462,10 +1462,14 @@ solution_replay=1; optionquery[1]=Q_progress; t=xrm_get_resource(resourcedb,optionquery,optionquery,2); pro=t?strtol(t,0,10):0; if(main_options['t']) pro=0; + if(main_options['+']) { + lvl=1; + goto start2; + } optionquery[1]=Q_level; t=xrm_get_resource(resourcedb,optionquery,optionquery,2); if(n=lvl=t?strtol(t,0,10):0) goto start; for(n=1;n<=level_nindex;n++) { if(lvl) break; @@ -1474,10 +1478,11 @@ if(main_options['t']) printf("*** Level %d\n",n); else printf("Level %d",n); if(t=load_level(-n)) { printf(": Error during loading: %s\n",t); rc=1; continue; } + start2: load_replay(); if(!replay_count) { printf(": Solution is absent, invalid, or for wrong version of this level\n"); rc=1; continue; } Index: main.c ================================================================== --- main.c +++ main.c @@ -1131,11 +1131,14 @@ optionquery[1]=Q_maxObjects; max_objects=strtoll(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,0)?:0xFFFF0000L; set_tracing(); annihilate(); optionquery[1]=Q_level; - if(level_ord=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10)) { + if(main_options['+']) { + level_id=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10); + if(log_if_error(load_level(level_id))) fatal("Cannot load level with specified ID\n"); + } else if(level_ord=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10)) { if(level_ord>level_nindex) level_ord=level_nindex; log_if_error(load_level(-level_ord)); } optionquery[1]=Q_maxTrigger; max_trigger=strtol(xrm_get_resource(resourcedb,optionquery,optionquery,2)?:"",0,10); Index: man6/heromesh.6 ================================================================== --- man6/heromesh.6 +++ man6/heromesh.6 @@ -51,10 +51,12 @@ .IP -x Does not start the GUI; instead, accepts SQL statements from stdin. .IP -z Load a composite puzzle set. In this case, pass the full file name instead only the base name. +.IP -+ +Load the level whose ID number is specified by the "level" resource. .SH FILES A puzzle set consists of four files, with filename suffixes .BR ".class" ", " ".xclass" ", " ".level" ", and " ".solution" "." A composite puzzle set consists of a single file. .TP