Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2019-05-05 13:42:29 -04:00
3 changed files with 596 additions and 526 deletions
+8 -7
View File
@@ -4,12 +4,12 @@ NetHack 3.6 is an enhancement to the dungeon exploration game NetHack,
which is a distant descendent of Rogue and Hack, and a direct descendent of which is a distant descendent of Rogue and Hack, and a direct descendent of
NetHack 3.4 as there was no NetHack 3.5 release. NetHack 3.4 as there was no NetHack 3.5 release.
NetHack 3.6.2 contains a collection of more than 220 bug fixes to NetHack 3.6.1. NetHack 3.6.2 contains a collection of about 320 bug fixes to NetHack 3.6.1
The file doc/fixes36.2 in the source distribution has a full list of them. The and more than 20 enhancements. The file doc/fixes36.2 in the source
text in there was written for the development team's own use and is provided distribution has a full list of them. The text in there was written for the
"as is", so please do not ask us to further explain the entries in that file. development team's own use and is provided "as is", so please do not ask us
Some entries might be considered "spoilers", particularly in the "new features" to further explain the entries in that file. Some entries might be considered
section. "spoilers", particularly in the "new features" section.
Below you will find some other general notes that were not considered Below you will find some other general notes that were not considered
spoilers: spoilers:
@@ -18,6 +18,7 @@ spoilers:
* sys/winnt/nttty performance improvements mainly through the introduction * sys/winnt/nttty performance improvements mainly through the introduction
of a back buffer approach of a back buffer approach
* a couple of windows crash bug fixes * a couple of windows crash bug fixes
* adoption of the curses window port that was in use in the community
- - - - - - - - - - - - - - - - - - - - - -
@@ -166,6 +167,6 @@ In our own patches, we will assume that your code is synchronized with ours.
-- Good luck, and happy Hacking -- -- Good luck, and happy Hacking --
# $NHDT-Date: 1546383333 2019/01/01 22:55:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.48 $ # $NHDT-Date: 1557077369 2019/05/05 17:29:29 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.55 $
# Copyright (c) 2012 by Michael Allison # Copyright (c) 2012 by Michael Allison
# NetHack may be freely redistributed. See license for details. # NetHack may be freely redistributed. See license for details.
+525 -461
View File
File diff suppressed because it is too large Load Diff
+63 -58
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 display.c $NHDT-Date: 1554045810 2019/03/31 15:23:30 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.99 $ */ /* NetHack 3.6 display.c $NHDT-Date: 1556835736 2019/05/02 22:22:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.101 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */ /* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */ /* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -37,9 +37,15 @@
* background * background
* *
* If the location is out of sight, display in order: * If the location is out of sight, display in order:
* sensed monsters (telepathy) * sensed monsters (via telepathy or persistent detection)
* warning (partly-sensed monster shown as an abstraction)
* memory * memory
* *
* "Remembered, unseen monster" is handled like an object rather
* than a monster, and stays displayed whether or not it is in sight.
* It is removed when a visible or sensed or warned-of monster gets
* shown at its location or when searching or fighting reveals that
* no monster is there.
* *
* *
* Here is a list of the major routines in this file to be used externally: * Here is a list of the major routines in this file to be used externally:
@@ -309,9 +315,9 @@ register int x, y;
if (!g.level.flags.hero_memory) if (!g.level.flags.hero_memory)
return; return;
if ((trap = t_at(x, y)) != 0 && trap->tseen && !covers_traps(x, y)) if ((trap = t_at(x, y)) != 0 && trap->tseen && !covers_traps(x, y)) {
map_trap(trap, 0); map_trap(trap, 0);
else if (levl[x][y].seenv) { } else if (levl[x][y].seenv) {
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
map_background(x, y, 0); map_background(x, y, 0);
@@ -320,8 +326,9 @@ register int x, y;
if (!lev->waslit && lev->glyph == cmap_to_glyph(S_room) if (!lev->waslit && lev->glyph == cmap_to_glyph(S_room)
&& lev->typ == ROOM) && lev->typ == ROOM)
lev->glyph = cmap_to_glyph(S_stone); lev->glyph = cmap_to_glyph(S_stone);
} else } else {
levl[x][y].glyph = cmap_to_glyph(S_stone); /* default val */ levl[x][y].glyph = cmap_to_glyph(S_stone); /* default val */
}
} }
/* /*
@@ -332,7 +339,7 @@ register int x, y;
* *
* Internal to display.c, this is a #define for speed. * Internal to display.c, this is a #define for speed.
*/ */
#define _map_location(x, y, show) \ #define _map_location(x, y, show) \
{ \ { \
register struct obj *obj; \ register struct obj *obj; \
register struct trap *trap; \ register struct trap *trap; \
@@ -440,8 +447,7 @@ xchar worm_tail; /* mon is actually a worm tail */
} }
} }
/* If the mimic is unsuccessfully mimicing something, display the monster. /* If mimic is unsuccessfully mimicing something, display the monster. */
*/
if (!mon_mimic || sensed) { if (!mon_mimic || sensed) {
int num; int num;
@@ -461,13 +467,13 @@ xchar worm_tail; /* mon is actually a worm tail */
} else if (sightflags == DETECTED) { } else if (sightflags == DETECTED) {
if (worm_tail) if (worm_tail)
num = detected_monnum_to_glyph( num = detected_monnum_to_glyph(
what_mon(PM_LONG_WORM_TAIL, rn2_on_display_rng)); what_mon(PM_LONG_WORM_TAIL, rn2_on_display_rng));
else else
num = detected_mon_to_glyph(mon, rn2_on_display_rng); num = detected_mon_to_glyph(mon, rn2_on_display_rng);
} else { } else {
if (worm_tail) if (worm_tail)
num = monnum_to_glyph( num = monnum_to_glyph(
what_mon(PM_LONG_WORM_TAIL, rn2_on_display_rng)); what_mon(PM_LONG_WORM_TAIL, rn2_on_display_rng));
else else
num = mon_to_glyph(mon, rn2_on_display_rng); num = mon_to_glyph(mon, rn2_on_display_rng);
} }
@@ -618,10 +624,9 @@ xchar x, y;
* floor symbol. * floor symbol.
* *
* Similarly, if the hero digs a hole in a wall or feels a * Similarly, if the hero digs a hole in a wall or feels a
* location * location that used to contain an unseen monster. In these
* that used to contain an unseen monster. In these cases, * cases, there's no reason to assume anything was underneath,
* there's no reason to assume anything was underneath, so * so just show the appropriate floor symbol. If something was
* just show the appropriate floor symbol. If something was
* embedded in the wall, the glyph will probably already * embedded in the wall, the glyph will probably already
* reflect that. Don't change the symbol in this case. * reflect that. Don't change the symbol in this case.
* *
@@ -860,7 +865,7 @@ register int x, y;
else else
goto show_mem; goto show_mem;
} else { } else {
show_mem: show_mem:
show_glyph(x, y, lev->glyph); show_glyph(x, y, lev->glyph);
} }
} }
@@ -910,24 +915,22 @@ int x, y;
* but explode() wants to delay]. * but explode() wants to delay].
* *
* Call: * Call:
* (DISP_BEAM, glyph) open, initialize glyph * (DISP_BEAM, glyph) open, initialize glyph
* (DISP_FLASH, glyph) open, initialize glyph * (DISP_FLASH, glyph) open, initialize glyph
* (DISP_ALWAYS, glyph) open, initialize glyph * (DISP_ALWAYS, glyph) open, initialize glyph
* (DISP_CHANGE, glyph) change glyph * (DISP_CHANGE, glyph) change glyph
* (DISP_END, 0) close & clean up (second argument doesn't * (DISP_END, 0) close & clean up (2nd argument doesn't matter)
* matter) * (DISP_FREEMEM, 0) only used to prevent memory leak during exit)
* (DISP_FREEMEM, 0) only used to prevent memory leak during
* exit)
* (x, y) display the glyph at the location * (x, y) display the glyph at the location
* *
* DISP_BEAM - Display the given glyph at each location, but do not erase * DISP_BEAM - Display the given glyph at each location, but do not erase
* any until the close call. * any until the close call.
* DISP_TETHER- Display a tether glyph at each location, and the tethered * DISP_TETHER - Display a tether glyph at each location, and the tethered
* object at the farthest location, but do not erase any * object at the farthest location, but do not erase any
* until the return trip or close. * until the return trip or close.
* DISP_FLASH - Display the given glyph at each location, but erase the * DISP_FLASH - Display the given glyph at each location, but erase the
* previous location's glyph. * previous location's glyph.
* DISP_ALWAYS- Like DISP_FLASH, but vision is not taken into account. * DISP_ALWAYS - Like DISP_FLASH, but vision is not taken into account.
*/ */
#define TMP_AT_MAX_GLYPHS (COLNO * 2) #define TMP_AT_MAX_GLYPHS (COLNO * 2)
@@ -956,7 +959,7 @@ int x, y;
if (!tglyph) if (!tglyph)
tmp = &tgfirst; tmp = &tgfirst;
else /* nested effect; we need dynamic memory */ else /* nested effect; we need dynamic memory */
tmp = (struct tmp_glyph *) alloc(sizeof(struct tmp_glyph)); tmp = (struct tmp_glyph *) alloc(sizeof *tmp);
tmp->prev = tglyph; tmp->prev = tglyph;
tglyph = tmp; tglyph = tmp;
tglyph->sidx = 0; tglyph->sidx = 0;
@@ -1584,8 +1587,8 @@ int cursor_on_u;
/* Prevent infinite loops on errors: /* Prevent infinite loops on errors:
* flush_screen->print_glyph->impossible->pline->flush_screen * flush_screen->print_glyph->impossible->pline->flush_screen
*/ */
static boolean flushing = 0; static int flushing = 0;
static boolean delay_flushing = 0; static int delay_flushing = 0;
register int x, y; register int x, y;
if (cursor_on_u == -1) if (cursor_on_u == -1)
@@ -1602,7 +1605,7 @@ int cursor_on_u;
for (y = 0; y < ROWNO; y++) { for (y = 0; y < ROWNO; y++) {
register gbuf_entry *gptr = &g.gbuf[y][x = g.gbuf_start[y]]; register gbuf_entry *gptr = &g.gbuf[y][x = g.gbuf_start[y]];
for (; x <= g.gbuf_stop[y]; gptr++, x++)
if (gptr->gnew) { if (gptr->gnew) {
print_glyph(WIN_MAP, x, y, gptr->glyph, get_bk_glyph(x, y)); print_glyph(WIN_MAP, x, y, gptr->glyph, get_bk_glyph(x, y));
gptr->gnew = 0; gptr->gnew = 0;
@@ -1843,7 +1846,7 @@ xchar x, y;
struct rm *lev = &levl[x][y]; struct rm *lev = &levl[x][y];
if (iflags.use_background_glyph && lev->seenv != 0 if (iflags.use_background_glyph && lev->seenv != 0
&& g.gbuf[y][x].glyph != cmap_to_glyph(S_stone)) { && g.gbuf[y][x].glyph != cmap_to_glyph(S_stone)) {
switch (lev->typ) { switch (lev->typ) {
case SCORR: case SCORR:
case STONE: case STONE:
@@ -1894,10 +1897,8 @@ xchar x, y;
return bkglyph; return bkglyph;
} }
/* ------------------------------------------------------------------------- /* ------------------------------------------------------------------------ */
*/ /* Wall Angle ------------------------------------------------------------- */
/* Wall Angle --------------------------------------------------------------
*/
#ifdef WA_VERBOSE #ifdef WA_VERBOSE
@@ -1943,6 +1944,7 @@ check_pos(x, y, which)
int x, y, which; int x, y, which;
{ {
int type; int type;
if (!isok(x, y)) if (!isok(x, y))
return which; return which;
type = levl[x][y].typ; type = levl[x][y].typ;
@@ -1977,8 +1979,11 @@ int x1, y1, x2, y2, x3, y3;
{ {
int wmode, is_1, is_2, is_3; int wmode, is_1, is_2, is_3;
#ifndef WA_VERBOSE
/* non-verbose more_than_one() doesn't use these */
nhUse(x0); nhUse(x0);
nhUse(y0); nhUse(y0);
#endif
is_1 = check_pos(x1, y1, WM_T_LONG); is_1 = check_pos(x1, y1, WM_T_LONG);
is_2 = check_pos(x2, y2, WM_T_BL); is_2 = check_pos(x2, y2, WM_T_BL);
@@ -2157,8 +2162,7 @@ set_wall_state()
#endif /* WA_VERBOSE */ #endif /* WA_VERBOSE */
} }
/* ------------------------------------------------------------------------- /* ------------------------------------------------------------------------ */
*/
/* This matrix is used here and in vision.c. */ /* This matrix is used here and in vision.c. */
unsigned char seenv_matrix[3][3] = { { SV2, SV1, SV0 }, unsigned char seenv_matrix[3][3] = { { SV2, SV1, SV0 },
{ SV3, SVALL, SV7 }, { SV3, SVALL, SV7 },
@@ -2189,8 +2193,7 @@ int x0, y0, x1, y1; /* from, to; abs(x1-x0)==1 && abs(y0-y1)==1 */
lev->seenv &= ~seenv_matrix[dy + 1][dx + 1]; lev->seenv &= ~seenv_matrix[dy + 1][dx + 1];
} }
/* ------------------------------------------------------------------------- /* ------------------------------------------------------------------------ */
*/
/* T wall types, one for each row in wall_matrix[][]. */ /* T wall types, one for each row in wall_matrix[][]. */
#define T_d 0 #define T_d 0
@@ -2304,7 +2307,7 @@ struct rm *lev;
goto do_twall; goto do_twall;
case TDWALL: case TDWALL:
row = wall_matrix[T_d]; row = wall_matrix[T_d];
do_twall: do_twall:
switch (lev->wall_info & WM_MASK) { switch (lev->wall_info & WM_MASK) {
case 0: case 0:
if (seenv == SV4) { if (seenv == SV4) {
@@ -2338,13 +2341,14 @@ struct rm *lev;
break; break;
case WM_T_BL: case WM_T_BL:
#if 0 /* older method, fixed */ #if 0 /* older method, fixed */
if (only(seenv, SV4|SV5)) { if (only(seenv, SV4 | SV5)) {
col = T_tlcorn; col = T_tlcorn;
} else if ((seenv & (SV0|SV1|SV2)) } else if ((seenv & (SV0 | SV1 | SV2))
&& only(seenv, SV0|SV1|SV2|SV6|SV7)) { && only(seenv, SV0 | SV1 | SV2 | SV6 | SV7)) {
col = T_hwall; col = T_hwall;
} else if ((seenv & SV3) } else if ((seenv & SV3)
|| ((seenv & (SV0|SV1|SV2)) && (seenv & (SV4|SV5)))) { || ((seenv & (SV0 | SV1 | SV2))
&& (seenv & (SV4 | SV5)))) {
col = T_tdwall; col = T_tdwall;
} else { } else {
if (seenv != SV6) if (seenv != SV6)
@@ -2364,13 +2368,14 @@ struct rm *lev;
break; break;
case WM_T_BR: case WM_T_BR:
#if 0 /* older method, fixed */ #if 0 /* older method, fixed */
if (only(seenv, SV5|SV6)) { if (only(seenv, SV5 | SV6)) {
col = T_trcorn; col = T_trcorn;
} else if ((seenv & (SV0|SV1|SV2)) } else if ((seenv & (SV0 | SV1 | SV2))
&& only(seenv, SV0|SV1|SV2|SV3|SV4)) { && only(seenv, SV0 | SV1 | SV2 | SV3 | SV4)) {
col = T_hwall; col = T_hwall;
} else if ((seenv & SV7) } else if ((seenv & SV7)
|| ((seenv & (SV0|SV1|SV2)) && (seenv & (SV5|SV6)))) { || ((seenv & (SV0 | SV1 | SV2))
&& (seenv & (SV5 | SV6)))) {
col = T_tdwall; col = T_tdwall;
} else { } else {
if (seenv != SV4) if (seenv != SV4)
@@ -2401,7 +2406,7 @@ struct rm *lev;
case SDOOR: case SDOOR:
if (lev->horizontal) if (lev->horizontal)
goto horiz; goto horiz;
/* fall through */ /*FALLTHRU*/
case VWALL: case VWALL:
switch (lev->wall_info & WM_MASK) { switch (lev->wall_info & WM_MASK) {
case 0: case 0:
@@ -2422,7 +2427,7 @@ struct rm *lev;
break; break;
case HWALL: case HWALL:
horiz: horiz:
switch (lev->wall_info & WM_MASK) { switch (lev->wall_info & WM_MASK) {
case 0: case 0:
idx = seenv ? S_hwall : S_stone; idx = seenv ? S_hwall : S_stone;
@@ -2513,10 +2518,10 @@ struct rm *lev;
goto do_crwall; goto do_crwall;
case WM_X_BR: case WM_X_BR:
row = cross_matrix[C_br]; row = cross_matrix[C_br];
do_crwall: do_crwall:
if (seenv == SV4) if (seenv == SV4) {
idx = S_stone; idx = S_stone;
else { } else {
seenv = seenv & ~SV4; /* strip SV4 */ seenv = seenv & ~SV4; /* strip SV4 */
if (seenv == SV0) { if (seenv == SV0) {
col = C_brcorn; col = C_brcorn;