Add paranoid option for breaking a wand

Add OPTION=paranoid_confirm:wand to prevent accidental
wand breaking - suggested by scorchgeek
This commit is contained in:
Pasi Kallinen
2015-09-27 19:13:13 +03:00
parent 58b9391de8
commit d9bc2fb621
5 changed files with 13 additions and 2 deletions

View File

@@ -3065,8 +3065,9 @@ struct obj *obj;
char confirm[QBUFSZ], buf[BUFSZ];
boolean is_fragile = (!strcmp(OBJ_DESCR(objects[obj->otyp]), "balsa"));
if (yn(safe_qbuf(confirm, "Are you really sure you want to break ", "?",
obj, yname, ysimple_name, "the wand")) == 'n')
if (!paranoid_query(ParanoidBreakwand,
safe_qbuf(confirm, "Are you really sure you want to break ",
"?", obj, yname, ysimple_name, "the wand")))
return 0;
if (nohands(youmonst.data)) {

View File

@@ -1186,6 +1186,8 @@ STATIC_VAR const struct paranoia_opts {
"y to pray (supersedes old \"prayconfirm\" option)" },
{ PARANOID_REMOVE, "Remove", 1, "Takeoff", 1,
"always pick from inventory for Remove and Takeoff" },
{ PARANOID_BREAKWAND, "wand", 1, "breakwand", 2,
"yes vs y to break a wand" },
/* for config file parsing; interactive menu skips these */
{ 0, "none", 4, 0, 0, 0 }, /* require full word match */
{ ~0, "all", 3, 0, 0, 0 }, /* ditto */