/* Options. */
- while ((ch = getopt(argc, argv, "l:or:s")) != EOF) {
+#ifndef ADVENT_NOSAVE
+ char* opts = "l:or:s";
+ char* usage = "Usage: %s [-l logfilename] [-o] [-r restorefilename] [-s] \n";
+#else
+ char* opts = "l:os";
+ char* usage = "Usage: %s [-l logfilename] [-o] [-s] \n";
+#endif
+ while ((ch = getopt(argc, argv, opts)) != EOF) {
switch (ch) {
case 'l':
logfp = fopen(optarg, "w");
oldstyle = true;
editline = prompt = false;
break;
+#ifndef ADVENT_NOSAVE
case 'r':
rfp = fopen(optarg, "r");
if (rfp == NULL)
optarg);
signal(SIGINT, sig_handler);
break;
+#endif
case 's':
editline = false;
break;
default:
fprintf(stderr,
- "Usage: %s [-l logfilename] [-o] [-r restorefilename] [-s] \n", argv[0]);
+ usage, argv[0]);
fprintf(stderr,
" where -l creates a log file of your game named as specified'\n");
fprintf(stderr,
" -o 'oldstyle' (no prompt, no command editing, displays 'Initialising...')\n");
+#ifndef ADVENT_NOSAVE
fprintf(stderr,
" -r indicates restoring from specified saved game file\n");
+#endif
fprintf(stderr,
" -s indicates playing with command editing suppressed\n");
exit(-1);
* death and exit. */
RSPEAK(DEATH_CLOSING);
terminate(endgame);
- }
- else if (game.numdie == maximum_deaths || !YES(query, yes_response, arbitrary_messages[OK_MAN]))
+ } else if (game.numdie == maximum_deaths || !YES(query, yes_response, arbitrary_messages[OK_MAN]))
terminate(endgame);
else {
game.place[WATER] = game.place[OIL] = NOWHERE;
do {
/*
* (ESR) This special-travel loop may have to be repeated if it includes
- * the plover passage. Same deal for any future cases wgerw we beed to
+ * the plover passage. Same deal for any future cases where we need to
* block travel and then redo it once the blocking condition has been
* removed.
*/
++kk;
game.newloc = labs(TRAVEL[kk]) / 1000;
} while
- (game.newloc == scratchloc);
+ (game.newloc == scratchloc);
scratchloc = game.newloc;
}
if (!SPECIAL(game.newloc))
return true;
if (game.newloc <= 500) {
- game.newloc = game.newloc - SPECIALBASE;
+ game.newloc -= SPECIALBASE;
switch (game.newloc) {
case 1:
/* Travel 301. Plover-alcove passage. Can carry only
++kk;
game.newloc = labs(TRAVEL[kk]) / 1000;
} while
- (game.newloc == scratchloc);
+ (game.newloc == scratchloc);
scratchloc = game.newloc;
continue; /* goto L12 */
case 3:
game.prop[BEAR] = 3;
game.oldlc2 = game.newloc;
croak();
+ return true;
}
}
BUG(SPECIAL_TRAVEL_500_GT_L_GT_300_EXCEEDS_GOTO_LIST);
game.prop[BATTERY] = 1;
if (TOTING(BATTERY))
DROP(BATTERY, game.loc);
- game.limit = game.limit + 2500;
+ game.limit += BATTERYLIFE;
game.lmwarn = false;
} else if (game.limit == 0) {
game.limit = -1;
else
continue; /* back to top of main interpreter loop */
}
- if (game.loc == 33 && PCT(25) && !game.closng)RSPEAK(SAYS_PLUGH);
+ if (game.loc == LOC_Y2 && PCT(25) && !game.closng)
+ RSPEAK(SAYS_PLUGH);
listobjects();