Merge branch 'NetHack-3.6.2'
This commit is contained in:
29
src/files.c
29
src/files.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1545702598 2018/12/25 01:49:58 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.248 $ */
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1546144856 2018/12/30 04:40:56 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.249 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -3202,37 +3202,26 @@ int which_set;
|
||||
|
||||
switch (symp->idx) {
|
||||
case 0:
|
||||
tmpsp =
|
||||
(struct symsetentry *) alloc(sizeof (struct symsetentry));
|
||||
tmpsp->next = (struct symsetentry *) 0;
|
||||
if (!g.symset_list) {
|
||||
g.symset_list = tmpsp;
|
||||
g.symset_count = 0;
|
||||
} else {
|
||||
g.symset_count++;
|
||||
tmpsp->next = g.symset_list;
|
||||
g.symset_list = tmpsp;
|
||||
}
|
||||
tmpsp->idx = g.symset_count;
|
||||
tmpsp = (struct symsetentry *) alloc(sizeof *tmpsp);
|
||||
tmpsp->next = g.symset_list;
|
||||
g.symset_list = tmpsp;
|
||||
tmpsp->idx = g.symset_count++;
|
||||
tmpsp->name = dupstr(bufp);
|
||||
tmpsp->desc = (char *) 0;
|
||||
tmpsp->nocolor = 0;
|
||||
tmpsp->handling = H_UNK;
|
||||
/* initialize restriction bits */
|
||||
tmpsp->nocolor = 0;
|
||||
tmpsp->primary = 0;
|
||||
tmpsp->rogue = 0;
|
||||
break;
|
||||
case 2:
|
||||
/* handler type identified */
|
||||
tmpsp = g.symset_list; /* most recent symset */
|
||||
tmpsp->handling = H_UNK;
|
||||
i = 0;
|
||||
while (known_handling[i]) {
|
||||
for (i = 0; known_handling[i]; ++i)
|
||||
if (!strcmpi(known_handling[i], bufp)) {
|
||||
tmpsp->handling = i;
|
||||
break; /* while loop */
|
||||
break; /* for loop */
|
||||
}
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
case 3: /* description:something */
|
||||
tmpsp = g.symset_list; /* most recent symset */
|
||||
|
||||
106
src/options.c
106
src/options.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 options.c $NHDT-Date: 1544773907 2018/12/14 07:51:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.347 $ */
|
||||
/* NetHack 3.6 options.c $NHDT-Date: 1546144857 2018/12/30 04:40:57 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.349 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2008. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -5188,8 +5188,7 @@ boolean setinitial, setfromfile;
|
||||
} else if (!strcmp("symset", optname)
|
||||
|| !strcmp("roguesymset", optname)) {
|
||||
menu_item *symset_pick = (menu_item *) 0;
|
||||
boolean primaryflag = (*optname == 's'),
|
||||
rogueflag = (*optname == 'r'),
|
||||
boolean rogueflag = (*optname == 'r'),
|
||||
ready_to_switch = FALSE,
|
||||
nothing_to_do = FALSE;
|
||||
char *symset_name, fmtstr[20];
|
||||
@@ -5197,37 +5196,33 @@ boolean setinitial, setfromfile;
|
||||
int res, which_set, setcount = 0, chosen = -2;
|
||||
|
||||
which_set = rogueflag ? ROGUESET : PRIMARY;
|
||||
|
||||
symset_list = (struct symsetentry *) 0;
|
||||
/* clear symset[].name as a flag to read_sym_file() to build list */
|
||||
symset_name = g.symset[which_set].name;
|
||||
g.symset[which_set].name = (char *) 0;
|
||||
g.symset_list = (struct symsetentry *) 0;
|
||||
|
||||
res = read_sym_file(which_set);
|
||||
if (res && g.symset_list) {
|
||||
char symsetchoice[BUFSZ];
|
||||
int let = 'a', biggest = 0, thissize = 0;
|
||||
|
||||
sl = g.symset_list;
|
||||
while (sl) {
|
||||
/* put symset name back */
|
||||
g.symset[which_set].name = symset_name;
|
||||
|
||||
if (res && g.symset_list) {
|
||||
int thissize, biggest = 0;
|
||||
|
||||
for (sl = g.symset_list; sl; sl = sl->next) {
|
||||
/* check restrictions */
|
||||
if ((!rogueflag && sl->rogue)
|
||||
|| (!primaryflag && sl->primary)) {
|
||||
sl = sl->next;
|
||||
if (rogueflag ? sl->primary : sl->rogue)
|
||||
continue;
|
||||
}
|
||||
|
||||
setcount++;
|
||||
/* find biggest name */
|
||||
if (sl->name)
|
||||
thissize = strlen(sl->name);
|
||||
thissize = sl->name ? (int) strlen(sl->name) : 0;
|
||||
if (thissize > biggest)
|
||||
biggest = thissize;
|
||||
sl = sl->next;
|
||||
}
|
||||
if (!setcount) {
|
||||
pline("There are no appropriate %ssymbol sets available.",
|
||||
(rogueflag) ? "rogue level "
|
||||
: (primaryflag) ? "primary " : "");
|
||||
pline("There are no appropriate %s symbol sets available.",
|
||||
rogueflag ? "rogue level" : "primary");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -5236,29 +5231,20 @@ boolean setinitial, setfromfile;
|
||||
start_menu(tmpwin);
|
||||
any = g.zeroany;
|
||||
any.a_int = 1;
|
||||
add_menu(tmpwin, NO_GLYPH, &any, let++, 0, ATR_NONE,
|
||||
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE,
|
||||
"Default Symbols", MENU_UNSELECTED);
|
||||
|
||||
sl = g.symset_list;
|
||||
while (sl) {
|
||||
for (sl = g.symset_list; sl; sl = sl->next) {
|
||||
/* check restrictions */
|
||||
if ((!rogueflag && sl->rogue)
|
||||
|| (!primaryflag && sl->primary)) {
|
||||
sl = sl->next;
|
||||
if (rogueflag ? sl->primary : sl->rogue)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sl->name) {
|
||||
any.a_int = sl->idx + 2;
|
||||
Sprintf(symsetchoice, fmtstr, sl->name,
|
||||
sl->desc ? sl->desc : "");
|
||||
add_menu(tmpwin, NO_GLYPH, &any, let, 0, ATR_NONE,
|
||||
symsetchoice, MENU_UNSELECTED);
|
||||
if (let == 'z')
|
||||
let = 'A';
|
||||
else
|
||||
let++;
|
||||
Sprintf(buf, fmtstr, sl->name, sl->desc ? sl->desc : "");
|
||||
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE,
|
||||
buf, MENU_UNSELECTED);
|
||||
}
|
||||
sl = sl->next;
|
||||
}
|
||||
Sprintf(buf, "Select %ssymbol set:",
|
||||
rogueflag ? "rogue level " : "");
|
||||
@@ -5271,30 +5257,20 @@ boolean setinitial, setfromfile;
|
||||
|
||||
if (chosen > -1) {
|
||||
/* chose an actual symset name from file */
|
||||
sl = g.symset_list;
|
||||
while (sl) {
|
||||
if (sl->idx == chosen) {
|
||||
if (symset_name) {
|
||||
free((genericptr_t) symset_name);
|
||||
symset_name = (char *) 0;
|
||||
}
|
||||
/* free the now stale attributes */
|
||||
clear_symsetentry(which_set, TRUE);
|
||||
|
||||
/* transfer only the name of the symbol set */
|
||||
g.symset[which_set].name = dupstr(sl->name);
|
||||
ready_to_switch = TRUE;
|
||||
for (sl = symset_list; sl; sl = sl->next)
|
||||
if (sl->idx == chosen)
|
||||
break;
|
||||
}
|
||||
sl = sl->next;
|
||||
if (sl) {
|
||||
/* free the now stale attributes */
|
||||
clear_symsetentry(which_set, TRUE);
|
||||
|
||||
/* transfer only the name of the symbol set */
|
||||
g.symset[which_set].name = dupstr(sl->name);
|
||||
ready_to_switch = TRUE;
|
||||
}
|
||||
} else if (chosen == -1) {
|
||||
/* explicit selection of defaults */
|
||||
/* free the now stale symset attributes */
|
||||
if (symset_name) {
|
||||
free((genericptr_t) symset_name);
|
||||
symset_name = (char *) 0;
|
||||
}
|
||||
clear_symsetentry(which_set, TRUE);
|
||||
} else
|
||||
nothing_to_do = TRUE;
|
||||
@@ -5309,26 +5285,18 @@ boolean setinitial, setfromfile;
|
||||
}
|
||||
|
||||
/* clean up */
|
||||
while (g.symset_list) {
|
||||
sl = g.symset_list;
|
||||
if (sl->name)
|
||||
free((genericptr_t) sl->name);
|
||||
sl->name = (char *) 0;
|
||||
|
||||
if (sl->desc)
|
||||
free((genericptr_t) sl->desc);
|
||||
sl->desc = (char *) 0;
|
||||
|
||||
while ((sl = g.symset_list) != 0) {
|
||||
g.symset_list = sl->next;
|
||||
if (sl->name)
|
||||
free((genericptr_t) sl->name), sl->name = (char *) 0;
|
||||
if (sl->desc)
|
||||
free((genericptr_t) sl->desc), sl->desc = (char *) 0;
|
||||
free((genericptr_t) sl);
|
||||
}
|
||||
|
||||
if (nothing_to_do)
|
||||
return TRUE;
|
||||
|
||||
if (!g.symset[which_set].name && symset_name)
|
||||
g.symset[which_set].name = symset_name; /* not dupstr() here */
|
||||
|
||||
/* Set default symbols and clear the handling value */
|
||||
if (rogueflag)
|
||||
init_r_symbols();
|
||||
@@ -5336,6 +5304,7 @@ boolean setinitial, setfromfile;
|
||||
init_l_symbols();
|
||||
|
||||
if (g.symset[which_set].name) {
|
||||
/* non-default symbols */
|
||||
if (read_sym_file(which_set)) {
|
||||
ready_to_switch = TRUE;
|
||||
} else {
|
||||
@@ -5354,7 +5323,6 @@ boolean setinitial, setfromfile;
|
||||
assign_graphics(PRIMARY);
|
||||
preference_update("symset");
|
||||
g.opt_need_redraw = TRUE;
|
||||
return TRUE;
|
||||
|
||||
} else {
|
||||
/* didn't match any of the special options */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 pager.c $NHDT-Date: 1545774524 2018/12/25 21:48:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.145 $ */
|
||||
/* NetHack 3.6 pager.c $NHDT-Date: 1546144745 2018/12/30 04:39:05 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.146 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2018. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -861,9 +861,9 @@ struct permonst **for_supplement;
|
||||
|
||||
/* Check for monsters */
|
||||
if (!iflags.terrainmode || (iflags.terrainmode & TER_MON) != 0) {
|
||||
for (i = 0; i < MAXMCLASSES; i++) {
|
||||
for (i = 1; i < MAXMCLASSES; i++) {
|
||||
if (sym == (looked ? g.showsyms[i + SYM_OFF_M] : def_monsyms[i].sym)
|
||||
&& def_monsyms[i].explain) {
|
||||
&& def_monsyms[i].explain && *def_monsyms[i].explain) {
|
||||
need_to_look = TRUE;
|
||||
if (!found) {
|
||||
Sprintf(out_str, "%s%s",
|
||||
@@ -1235,7 +1235,7 @@ coord *click_cc;
|
||||
}
|
||||
|
||||
found = do_screen_description(cc, (from_screen || clicklook), sym,
|
||||
out_str, &firstmatch, &supplemental_pm);
|
||||
out_str, &firstmatch, &supplemental_pm);
|
||||
|
||||
/* Finally, print out our explanation. */
|
||||
if (found) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 role.c $NHDT-Date: 1463561393 2016/05/18 08:49:53 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.38 $ */
|
||||
/* NetHack 3.6 role.c $NHDT-Date: 1546137492 2018/12/30 02:38:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.55 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1564,13 +1564,16 @@ int buflen, rolenum, racenum, gendnum, alignnum;
|
||||
Strcpy(tmpbuf, "Shall I pick ");
|
||||
if (racenum != ROLE_NONE || validrole(rolenum))
|
||||
Strcat(tmpbuf, "your ");
|
||||
else {
|
||||
else
|
||||
Strcat(tmpbuf, "a ");
|
||||
}
|
||||
/* <your> */
|
||||
|
||||
(void) root_plselection_prompt(eos(tmpbuf), buflen - strlen(tmpbuf),
|
||||
rolenum, racenum, gendnum, alignnum);
|
||||
/* "Shall I pick a character's role, race, gender, and alignment for you?"
|
||||
plus " [ynaq] (y)" is a little too long for a conventional 80 columns;
|
||||
also, "pick a character's <anything>" sounds a bit stilted */
|
||||
strsubst(tmpbuf, "pick a character", "pick character");
|
||||
Sprintf(buf, "%s", s_suffix(tmpbuf));
|
||||
/* don't bother splitting caveman/cavewoman or priest/priestess
|
||||
in order to apply possessive suffix to both halves, but do
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 version.c $NHDT-Date: 1524693365 2018/04/25 21:56:05 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.49 $ */
|
||||
/* NetHack 3.6 version.c $NHDT-Date: 1546137502 2018/12/30 02:38:22 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.51 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2018. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -68,7 +68,8 @@ char *buf;
|
||||
#if defined(NETHACK_GIT_BRANCH)
|
||||
#if defined(BETA)
|
||||
if (NetHack_git_branch)
|
||||
Sprintf(eos(buf), "%sbranch:%s", c++ ? "," : "", NetHack_git_branch);
|
||||
Sprintf(eos(buf), "%sbranch:%s",
|
||||
c++ ? "," : "", NetHack_git_branch);
|
||||
#endif
|
||||
#endif
|
||||
Sprintf(eos(buf), ")");
|
||||
|
||||
Reference in New Issue
Block a user