Merge branch 'NetHack-3.6' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6

This commit is contained in:
nhmall
2019-11-16 16:40:40 -05:00
4 changed files with 80 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.178 $ $NHDT-Date: 1573848574 2019/11/15 20:09:34 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.180 $ $NHDT-Date: 1573933605 2019/11/16 19:46:45 $
This fixes36.3 file is here to capture information about updates in the 3.6.x This fixes36.3 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.2 in May 2019. Please note, however, lineage following the release of 3.6.2 in May 2019. Please note, however,
@@ -233,6 +233,8 @@ dipping into an undiscovered potion would offer chance to give a name to the
dipping lichen corpse into acid when not blind and acid was undicovered would dipping lichen corpse into acid when not blind and acid was undicovered would
not offer a chance to give a name to the potion after lichen feedback not offer a chance to give a name to the potion after lichen feedback
pluralization improvement for words ending in a k-sound like "biotech" pluralization improvement for words ending in a k-sound like "biotech"
check for whether a monster was entering a region (gas cloud) erroneously
depended upon whether or not the hero was inside the same region
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 display.c $NHDT-Date: 1567213890 2019/08/31 01:11:30 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.106 $ */ /* NetHack 3.6 display.c $NHDT-Date: 1573934698 2019/11/16 20:04:58 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.107 $ */
/* 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. */
@@ -762,12 +762,19 @@ register int x, y;
*/ */
lev->waslit = (lev->lit != 0); /* remember lit condition */ lev->waslit = (lev->lit != 0); /* remember lit condition */
/* normal region shown only on accessible positions, but poison clouds mon = m_at(x, y);
* also shown above lava, pools and moats. worm_tail = is_worm_tail(mon);
/*
* Normal region shown only on accessible positions, but
* poison clouds also shown above lava, pools and moats.
* However, sensed monsters take precedence over all regions.
*/ */
if (reg && (ACCESSIBLE(lev->typ) if (reg
|| (reg->glyph == cmap_to_glyph(S_poisoncloud) && (ACCESSIBLE(lev->typ)
&& is_pool_or_lava(x, y)))) { || (reg->glyph == cmap_to_glyph(S_poisoncloud)
&& is_pool_or_lava(x, y)))
&& (!mon || worm_tail || !sensemon(mon))) {
show_region(reg, x, y); show_region(reg, x, y);
return; return;
} }
@@ -782,8 +789,6 @@ register int x, y;
if (see_self) if (see_self)
display_self(); display_self();
} else { } else {
mon = m_at(x, y);
worm_tail = is_worm_tail(mon);
see_it = mon && (mon_visible(mon) see_it = mon && (mon_visible(mon)
|| (!worm_tail && (tp_sensemon(mon) || (!worm_tail && (tp_sensemon(mon)
|| MATCH_WARN_OF_MON(mon)))); || MATCH_WARN_OF_MON(mon))));

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 region.c $NHDT-Date: 1543455828 2018/11/29 01:43:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.43 $ */ /* NetHack 3.6 region.c $NHDT-Date: 1573933605 2019/11/16 19:46:45 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.44 $ */
/* Copyright (c) 1996 by Jean-Christophe Collet */ /* Copyright (c) 1996 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -430,24 +430,25 @@ xchar x, y;
{ {
int i, f_indx; int i, f_indx;
/* First check if we can do the move */ /* First check if hero can do the move */
for (i = 0; i < n_regions; i++) { for (i = 0; i < n_regions; i++) {
if (inside_region(regions[i], x, y) && !hero_inside(regions[i]) if (regions[i]->attach_2_u)
&& !regions[i]->attach_2_u) { continue;
if ((f_indx = regions[i]->can_enter_f) != NO_CALLBACK) if (inside_region(regions[i], x, y)
if (!(*callbacks[f_indx])(regions[i], (genericptr_t) 0)) ? (!hero_inside(regions[i])
return FALSE; && (f_indx = regions[i]->can_enter_f) != NO_CALLBACK)
} else if (hero_inside(regions[i]) && !inside_region(regions[i], x, y) : (hero_inside(regions[i])
&& !regions[i]->attach_2_u) { && (f_indx = regions[i]->can_leave_f) != NO_CALLBACK)) {
if ((f_indx = regions[i]->can_leave_f) != NO_CALLBACK) if (!(*callbacks[f_indx])(regions[i], (genericptr_t) 0))
if (!(*callbacks[f_indx])(regions[i], (genericptr_t) 0)) return FALSE;
return FALSE;
} }
} }
/* Callbacks for the regions we do leave */ /* Callbacks for the regions hero does leave */
for (i = 0; i < n_regions; i++) for (i = 0; i < n_regions; i++) {
if (hero_inside(regions[i]) && !regions[i]->attach_2_u if (regions[i]->attach_2_u)
continue;
if (hero_inside(regions[i])
&& !inside_region(regions[i], x, y)) { && !inside_region(regions[i], x, y)) {
clear_hero_inside(regions[i]); clear_hero_inside(regions[i]);
if (regions[i]->leave_msg != (const char *) 0) if (regions[i]->leave_msg != (const char *) 0)
@@ -455,10 +456,13 @@ xchar x, y;
if ((f_indx = regions[i]->leave_f) != NO_CALLBACK) if ((f_indx = regions[i]->leave_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(regions[i], (genericptr_t) 0); (void) (*callbacks[f_indx])(regions[i], (genericptr_t) 0);
} }
}
/* Callbacks for the regions we do enter */ /* Callbacks for the regions hero does enter */
for (i = 0; i < n_regions; i++) for (i = 0; i < n_regions; i++) {
if (!hero_inside(regions[i]) && !regions[i]->attach_2_u if (regions[i]->attach_2_u)
continue;
if (!hero_inside(regions[i])
&& inside_region(regions[i], x, y)) { && inside_region(regions[i], x, y)) {
set_hero_inside(regions[i]); set_hero_inside(regions[i]);
if (regions[i]->enter_msg != (const char *) 0) if (regions[i]->enter_msg != (const char *) 0)
@@ -466,12 +470,14 @@ xchar x, y;
if ((f_indx = regions[i]->enter_f) != NO_CALLBACK) if ((f_indx = regions[i]->enter_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(regions[i], (genericptr_t) 0); (void) (*callbacks[f_indx])(regions[i], (genericptr_t) 0);
} }
}
return TRUE; return TRUE;
} }
/* /*
* check whether a monster enters/leaves one or more region. * check whether a monster enters/leaves one or more regions.
*/ */
boolean boolean
m_in_out_region(mon, x, y) m_in_out_region(mon, x, y)
struct monst *mon; struct monst *mon;
@@ -479,40 +485,44 @@ xchar x, y;
{ {
int i, f_indx; int i, f_indx;
/* First check if we can do the move */ /* First check if mon can do the move */
for (i = 0; i < n_regions; i++) { for (i = 0; i < n_regions; i++) {
if (inside_region(regions[i], x, y) && !mon_in_region(regions[i], mon) if (regions[i]->attach_2_m == mon->m_id)
&& regions[i]->attach_2_m != mon->m_id) { continue;
if ((f_indx = regions[i]->can_enter_f) != NO_CALLBACK) if (inside_region(regions[i], x, y)
if (!(*callbacks[f_indx])(regions[i], mon)) ? (!mon_in_region(regions[i], mon)
return FALSE; && (f_indx = regions[i]->can_enter_f) != NO_CALLBACK)
} else if (mon_in_region(regions[i], mon) : (mon_in_region(regions[i], mon)
&& !inside_region(regions[i], x, y) && (f_indx = regions[i]->can_leave_f) != NO_CALLBACK)) {
&& regions[i]->attach_2_m != mon->m_id) { if (!(*callbacks[f_indx])(regions[i], mon))
if ((f_indx = regions[i]->can_leave_f) != NO_CALLBACK) return FALSE;
if (!(*callbacks[f_indx])(regions[i], mon))
return FALSE;
} }
} }
/* Callbacks for the regions we do leave */ /* Callbacks for the regions mon does leave */
for (i = 0; i < n_regions; i++) for (i = 0; i < n_regions; i++) {
if (regions[i]->attach_2_m == mon->m_id)
continue;
if (mon_in_region(regions[i], mon) if (mon_in_region(regions[i], mon)
&& regions[i]->attach_2_m != mon->m_id
&& !inside_region(regions[i], x, y)) { && !inside_region(regions[i], x, y)) {
remove_mon_from_reg(regions[i], mon); remove_mon_from_reg(regions[i], mon);
if ((f_indx = regions[i]->leave_f) != NO_CALLBACK) if ((f_indx = regions[i]->leave_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(regions[i], mon); (void) (*callbacks[f_indx])(regions[i], mon);
} }
}
/* Callbacks for the regions we do enter */ /* Callbacks for the regions mon does enter */
for (i = 0; i < n_regions; i++) for (i = 0; i < n_regions; i++) {
if (!hero_inside(regions[i]) && !regions[i]->attach_2_u if (regions[i]->attach_2_m == mon->m_id)
continue;
if (!mon_in_region(regions[i], mon)
&& inside_region(regions[i], x, y)) { && inside_region(regions[i], x, y)) {
add_mon_to_reg(regions[i], mon); add_mon_to_reg(regions[i], mon);
if ((f_indx = regions[i]->enter_f) != NO_CALLBACK) if ((f_indx = regions[i]->enter_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(regions[i], mon); (void) (*callbacks[f_indx])(regions[i], mon);
} }
}
return TRUE; return TRUE;
} }
@@ -598,10 +608,12 @@ xchar x, y;
{ {
register int i; register int i;
for (i = 0; i < n_regions; i++) for (i = 0; i < n_regions; i++) {
if (inside_region(regions[i], x, y) && regions[i]->visible if (!regions[i]->visible || regions[i]->ttl == -2L)
&& regions[i]->ttl != -2L) continue;
if (inside_region(regions[i], x, y))
return regions[i]; return regions[i];
}
return (NhRegion *) 0; return (NhRegion *) 0;
} }

View File

@@ -209,8 +209,8 @@ static void
draw_status() draw_status()
{ {
WINDOW *win = curses_get_nhwin(STATUS_WIN); WINDOW *win = curses_get_nhwin(STATUS_WIN);
int orient = curses_get_window_orientation(STATUS_WIN); orient statorient = (orient) curses_get_window_orientation(STATUS_WIN);
boolean horiz = (orient != ALIGN_RIGHT && orient != ALIGN_LEFT); boolean horiz = (statorient != ALIGN_RIGHT && statorient != ALIGN_LEFT);
boolean border = curses_window_has_border(STATUS_WIN); boolean border = curses_window_has_border(STATUS_WIN);
/* Figure out if we have proper window dimensions for horizontal /* Figure out if we have proper window dimensions for horizontal
@@ -1722,18 +1722,14 @@ void
curses_update_stats(void) curses_update_stats(void)
{ {
WINDOW *win = curses_get_nhwin(STATUS_WIN); WINDOW *win = curses_get_nhwin(STATUS_WIN);
orient statorient = (orient) curses_get_window_orientation(STATUS_WIN);
boolean horiz = (statorient != ALIGN_RIGHT && statorient != ALIGN_LEFT);
boolean border = curses_window_has_border(STATUS_WIN);
/* Clear the window */ /* Clear the window */
werase(win); werase(win);
int orient = curses_get_window_orientation(STATUS_WIN); /* Figure out if we have proper window dimensions for horizontal status */
boolean horiz = FALSE;
if ((orient != ALIGN_RIGHT) && (orient != ALIGN_LEFT))
horiz = TRUE;
boolean border = curses_window_has_border(STATUS_WIN);
/* Figure out if we have proper window dimensions for horizontal statusbar. */
if (horiz) { if (horiz) {
/* correct y */ /* correct y */
int cy = 3; int cy = 3;
@@ -1752,7 +1748,8 @@ curses_update_stats(void)
curses_last_messages(); curses_last_messages();
doredraw(); doredraw();
/* Reset XP highlight (since classic_status and new show different numbers) */ /* Reset XP highlight (since classic_status and new show
different numbers) */
prevexp.highlight_turns = 0; prevexp.highlight_turns = 0;
curses_update_stats(); curses_update_stats();
return; return;
@@ -1778,7 +1775,7 @@ curses_update_stats(void)
hpmax = u.mhmax; hpmax = u.mhmax;
} }
if (orient != ALIGN_RIGHT && orient != ALIGN_LEFT) if (horiz)
draw_horizontal(x, y, hp, hpmax); draw_horizontal(x, y, hp, hpmax);
else else
draw_vertical(x, y, hp, hpmax); draw_vertical(x, y, hp, hpmax);
@@ -1791,7 +1788,8 @@ curses_update_stats(void)
if (first) { if (first) {
first = FALSE; first = FALSE;
/* Zero highlight timers. This will call curses_update_status again if needed */ /* Zero highlight timers. This will call curses_update_status again
if needed */
curses_decrement_highlights(TRUE); curses_decrement_highlights(TRUE);
} }
} }