prevent random traps from being created inside the shops in the tourist quest
if hero's steed got hit by knockback effect, impossible "no monster to remove"
would occur (plus more warnings if 'sanity_check' was On)
+the #saveoptions command included options changed via doset_simple() but not
+ ones changed via full doset()
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support
wait_synch();
pline("Some settings are not saved!");
wait_synch();
- pline("All manual customization and comments are removed from the file!");
+ pline(
+ "All manual customization and comments are removed from the file!");
wait_synch();
}
#define overwrite_prompt "Overwrite config file %.*s?"
- Sprintf(tmp, overwrite_prompt, (int)(BUFSZ - sizeof overwrite_prompt - 2), configfile);
+ Sprintf(tmp, overwrite_prompt,
+ (int) (BUFSZ - sizeof overwrite_prompt - 2), configfile);
#undef overwrite_prompt
if (!paranoid_query(TRUE, tmp))
return ECMD_OK;
fclose(fp);
strbuf_empty(&buf);
if (wrote != len)
- pline("An error occurred, wrote only partial data (%lu/%lu).", wrote, len);
+ pline("An error occurred, wrote only partial data (%lu/%lu).",
+ wrote, len);
}
return ECMD_OK;
}
free((genericptr_t) window_pick);
} else if (n == 0) { /* nothing was picked but menu wasn't cancelled */
/* something that was preselected got unselected, leaving nothing;
- treat that as picking 'none' (even though 'none' might be what
- got unselected) */
+ treat that as picking 'none' (even though 'none' is no longer
+ among the choices) */
flags.autounlock = 0;
}
destroy_nhwindow(tmpwin);
flags.verbose = !flags.verbose;
} else {
Sprintf(buf,
- "Set verbose_suppressor[%d] (%ld) to what new decimal value ?",
- j, verbosity_suppressions[j]);
+ "Set verbose_suppressor[%d] (%ld) to what new decimal value ?",
+ j, verbosity_suppressions[j]);
abuf[0] = '\0';
getlin(buf, abuf);
if (abuf[0] == '\033')
reslt = (*allopt[k].optfn)(allopt[k].idx, do_handler,
FALSE, empty_optstr,
empty_optstr);
+ /* if player eventually saves options, include this one */
+ if (reslt == optn_ok)
+ opt_set_in_config[k] = TRUE;
} else {
char abuf[BUFSZ];
- verbose */
buf2 = get_option_value(name, TRUE);
if (buf2) {
- Sprintf(tmp, "OPTIONS=%s:%s\n", name, buf2);
+ Snprintf(tmp, sizeof tmp - 1, "OPTIONS=%s:%s", name, buf2);
+ Strcat(tmp, "\n"); /* guaranteed to fit */
strbuf_append(sbuf, tmp);
}
break;