Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2

This commit is contained in:
nhmall
2018-09-14 18:27:06 -04:00
9 changed files with 88 additions and 40 deletions
+7 -1
View File
@@ -114,7 +114,9 @@ add window port status_update() value BL_RESET to use as a flag to
for hilite_status of string status fields (title, dungeon-level, alignment), for hilite_status of string status fields (title, dungeon-level, alignment),
the types value-goes-up and -down aren't meaningful; treat them as the types value-goes-up and -down aren't meaningful; treat them as
value-changed if from config file and don't offer as choices with 'O' value-changed if from config file and don't offer as choices with 'O'
spiders will occasionally spin webs when moving around jumping into or over a Sokoban pit, or over a fire trap, triggers trap twice
mimics created by #wizgenesis could block or not block vision incorrectly
handle monsters inside the invocation area
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
@@ -125,6 +127,8 @@ setting the inverse attribute for gold had the space before "$:"
sortloot segfaulted when filtering a subset of items (seen with 'A' command) sortloot segfaulted when filtering a subset of items (seen with 'A' command)
tty: turn off an optimization that is the suspected cause of Windows reported tty: turn off an optimization that is the suspected cause of Windows reported
partial status lines following level changes partial status lines following level changes
tty: ensure that current status fields are always copied to prior status
values so that comparisons are correct
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
@@ -162,6 +166,7 @@ unix: Makefile.src and Makefile.utl inadvertently relied on a 'gnu make'
Qt: add Qt5 specific hints file for linux and Mac OS X (Ray Chason) Qt: add Qt5 specific hints file for linux and Mac OS X (Ray Chason)
Qt: enable compiling Qt5 on Windows (Ray Chason) Qt: enable compiling Qt5 on Windows (Ray Chason)
Qt: entering extended commands, hide non-matching ones Qt: entering extended commands, hide non-matching ones
Qt: remember tile and font size
General New Features General New Features
@@ -179,6 +184,7 @@ make it clear when a leprechaun dodges your attack
wizard mode #wizidentify can now select individual items for permanent wizard mode #wizidentify can now select individual items for permanent
identification and don't display the selection to permanently identification and don't display the selection to permanently
identify everything if everything is already fully identified identify everything if everything is already fully identified
spiders will occasionally spin webs when moving around
Code Cleanup and Reorganization Code Cleanup and Reorganization
+21 -10
View File
@@ -571,7 +571,7 @@ int x, y;
int ox, oy, *range = (int *) arg; int ox, oy, *range = (int *) arg;
struct obj *obj; struct obj *obj;
struct monst *mon; struct monst *mon;
boolean may_pass = TRUE; boolean may_pass = TRUE, via_jumping, stopping_short;
struct trap *ttmp; struct trap *ttmp;
int dmg = 0; int dmg = 0;
@@ -583,6 +583,8 @@ int x, y;
} else if (*range == 0) { } else if (*range == 0) {
return FALSE; /* previous step wants to stop now */ return FALSE; /* previous step wants to stop now */
} }
via_jumping = (EWwalking & I_SPECIAL) != 0L;
stopping_short = (via_jumping && *range < 2);
if (!Passes_walls || !(may_pass = may_passwall(x, y))) { if (!Passes_walls || !(may_pass = may_passwall(x, y))) {
boolean odoor_diag = (IS_DOOR(levl[x][y].typ) boolean odoor_diag = (IS_DOOR(levl[x][y].typ)
@@ -710,12 +712,17 @@ int x, y;
vision_recalc(1); /* update for new position */ vision_recalc(1); /* update for new position */
flush_screen(1); flush_screen(1);
if (is_pool(x, y) && !u.uinwater if (is_pool(x, y) && !u.uinwater) {
&& ((Is_waterlevel(&u.uz) && levl[x][y].typ == WATER) if ((Is_waterlevel(&u.uz) && levl[x][y].typ == WATER)
|| !(Levitation || Flying || Wwalking))) { || !(Levitation || Flying || Wwalking)) {
multi = 0; /* can move, so drown() allows crawling out of water */ multi = 0; /* can move, so drown() allows crawling out of water */
(void) drown(); (void) drown();
return FALSE; return FALSE;
} else if (!Is_waterlevel(&u.uz) && !stopping_short) {
Norep("You move over %s.", an(is_moat(x, y) ? "moat" : "pool"));
}
} else if (is_lava(x, y) && !stopping_short) {
Norep("You move over some lava.");
} }
/* FIXME: /* FIXME:
@@ -727,7 +734,9 @@ int x, y;
* ones that we have not yet tested. * ones that we have not yet tested.
*/ */
if ((ttmp = t_at(x, y)) != 0) { if ((ttmp = t_at(x, y)) != 0) {
if (ttmp->ttyp == MAGIC_PORTAL) { if (stopping_short) {
; /* see the comment above hurtle_jump() */
} else if (ttmp->ttyp == MAGIC_PORTAL) {
dotrap(ttmp, 0); dotrap(ttmp, 0);
return FALSE; return FALSE;
} else if (ttmp->ttyp == VIBRATING_SQUARE) { } else if (ttmp->ttyp == VIBRATING_SQUARE) {
@@ -738,8 +747,10 @@ int x, y;
} else if ((ttmp->ttyp == PIT || ttmp->ttyp == SPIKED_PIT } else if ((ttmp->ttyp == PIT || ttmp->ttyp == SPIKED_PIT
|| ttmp->ttyp == HOLE || ttmp->ttyp == TRAPDOOR) || ttmp->ttyp == HOLE || ttmp->ttyp == TRAPDOOR)
&& Sokoban) { && Sokoban) {
/* Air currents overcome the recoil */ /* air currents overcome the recoil in Sokoban;
dotrap(ttmp, 0); when jumping, caller performs last step and enters trap */
if (!via_jumping)
dotrap(ttmp, 0);
*range = 0; *range = 0;
return TRUE; return TRUE;
} else { } else {
+3 -4
View File
@@ -2126,16 +2126,12 @@ register struct monst *mtmp;
appear = Is_rogue_level(&u.uz) ? S_hwall : S_hcdoor; appear = Is_rogue_level(&u.uz) ? S_hwall : S_hcdoor;
else else
appear = Is_rogue_level(&u.uz) ? S_vwall : S_vcdoor; appear = Is_rogue_level(&u.uz) ? S_vwall : S_vcdoor;
if (!mtmp->minvis || See_invisible)
block_point(mx, my); /* vision */
} else if (level.flags.is_maze_lev && !In_sokoban(&u.uz) && rn2(2)) { } else if (level.flags.is_maze_lev && !In_sokoban(&u.uz) && rn2(2)) {
ap_type = M_AP_OBJECT; ap_type = M_AP_OBJECT;
appear = STATUE; appear = STATUE;
} else if (roomno < 0 && !t_at(mx, my)) { } else if (roomno < 0 && !t_at(mx, my)) {
ap_type = M_AP_OBJECT; ap_type = M_AP_OBJECT;
appear = BOULDER; appear = BOULDER;
if (!mtmp->minvis || See_invisible)
block_point(mx, my); /* vision */
} else if (rt == ZOO || rt == VAULT) { } else if (rt == ZOO || rt == VAULT) {
ap_type = M_AP_OBJECT; ap_type = M_AP_OBJECT;
appear = GOLD_PIECE; appear = GOLD_PIECE;
@@ -2193,6 +2189,9 @@ register struct monst *mtmp;
if (appear == EGG && !can_be_hatched(MCORPSENM(mtmp))) if (appear == EGG && !can_be_hatched(MCORPSENM(mtmp)))
MCORPSENM(mtmp) = NON_PM; /* revert to generic egg */ MCORPSENM(mtmp) = NON_PM; /* revert to generic egg */
} }
if (does_block(mx, my, &levl[mx][my]))
block_point(mx, my);
} }
/* release monster from bag of tricks; return number of monsters created */ /* release monster from bag of tricks; return number of monsters created */
+15 -1
View File
@@ -1733,6 +1733,7 @@ int dist;
struct obj *otmp; struct obj *otmp;
boolean make_rocks; boolean make_rocks;
register struct rm *lev = &levl[x][y]; register struct rm *lev = &levl[x][y];
struct monst *mon;
/* clip at existing map borders if necessary */ /* clip at existing map borders if necessary */
if (!within_bounded_area(x, y, x_maze_min + 1, y_maze_min + 1, if (!within_bounded_area(x, y, x_maze_min + 1, y_maze_min + 1,
@@ -1759,7 +1760,6 @@ int dist;
obfree(otmp, (struct obj *) 0); obfree(otmp, (struct obj *) 0);
} }
} }
unblock_point(x, y); /* make sure vision knows this location is open */
/* fake out saved state */ /* fake out saved state */
lev->seenv = 0; lev->seenv = 0;
@@ -1796,6 +1796,20 @@ int dist;
break; break;
} }
if ((mon = m_at(x, y)) != 0) {
/* wake up mimics, don't want to deal with them blocking vision */
if (mon->m_ap_type)
seemimic(mon);
if ((ttmp = t_at(x, y)) != 0)
(void) mintrap(mon);
else
(void) minliquid(mon);
}
if (!does_block(x, y, lev))
unblock_point(x, y); /* make sure vision knows this location is open */
/* display new value of position; could have a monster/object on it */ /* display new value of position; could have a monster/object on it */
newsym(x, y); newsym(x, y);
} }
+7 -1
View File
@@ -2550,8 +2550,14 @@ struct _create_particular_data *d;
put_saddle_on_mon(otmp, mtmp); put_saddle_on_mon(otmp, mtmp);
} }
if (d->invisible) if (d->invisible) {
int mx = mtmp->mx, my = mtmp->my;
mon_set_minvis(mtmp); mon_set_minvis(mtmp);
if (does_block(mx, my, &levl[mx][my]))
block_point(mx, my);
else
unblock_point(mx, my);
}
if (d->sleeping) if (d->sleeping)
mtmp->msleeping = 1; mtmp->msleeping = 1;
madeany = TRUE; madeany = TRUE;
+4
View File
@@ -490,6 +490,10 @@ NetHackQtMainWindow::NetHackQtMainWindow(NetHackQtKeyBuffer& ks) :
addToolBar(toolbar); addToolBar(toolbar);
menubar = menuBar(); menubar = menuBar();
QCoreApplication::setOrganizationName("The NetHack DevTeam");
QCoreApplication::setOrganizationDomain("nethack.org");
QCoreApplication::setApplicationName("NetHack");
setWindowTitle("Qt NetHack"); setWindowTitle("Qt NetHack");
if ( qt_compact_mode ) if ( qt_compact_mode )
setWindowIcon(QIcon(QPixmap(nh_icon_small))); setWindowIcon(QIcon(QPixmap(nh_icon_small)));
+15 -6
View File
@@ -36,10 +36,11 @@ int qt_compact_mode = 0;
namespace nethack_qt4 { namespace nethack_qt4 {
#define TILEWMIN 1 #define TILEWMIN 6
#define TILEHMIN 1 #define TILEHMIN 6
NetHackQtSettings::NetHackQtSettings(int w, int h) : NetHackQtSettings::NetHackQtSettings(int w, int h) :
settings(),
tilewidth(this), tilewidth(this),
tileheight(this), tileheight(this),
widthlbl("&Width:",this), widthlbl("&Width:",this),
@@ -63,9 +64,9 @@ NetHackQtSettings::NetHackQtSettings(int w, int h) :
heightlbl.setBuddy(&tileheight); heightlbl.setBuddy(&tileheight);
tileheight.setRange(TILEHMIN, 128); tileheight.setRange(TILEHMIN, 128);
default_fontsize=2; tilewidth.setValue(settings.value("tilewidth", 16).toInt());
tilewidth.setValue(16); tileheight.setValue(settings.value("tileheight", 16).toInt());
tileheight.setValue(16); default_fontsize = settings.value("fontsize", 2).toInt();
// Tile/font sizes read from .nethackrc // Tile/font sizes read from .nethackrc
if (qt_tilewidth != NULL) { if (qt_tilewidth != NULL) {
@@ -100,7 +101,7 @@ NetHackQtSettings::NetHackQtSettings(int w, int h) :
fontsize.addItem("Small"); fontsize.addItem("Small");
fontsize.addItem("Tiny"); fontsize.addItem("Tiny");
fontsize.setCurrentIndex(default_fontsize); fontsize.setCurrentIndex(default_fontsize);
connect(&fontsize,SIGNAL(activated(int)),this,SIGNAL(fontChanged())); connect(&fontsize,SIGNAL(activated(int)),this,SLOT(changedFont()));
QGridLayout* grid = new QGridLayout(this); QGridLayout* grid = new QGridLayout(this);
grid->addWidget(&whichsize, 0, 0, 1, 2); grid->addWidget(&whichsize, 0, 0, 1, 2);
@@ -126,11 +127,19 @@ NetHackQtGlyphs& NetHackQtSettings::glyphs()
return *theglyphs; return *theglyphs;
} }
void NetHackQtSettings::changedFont()
{
settings.setValue("fontsize", fontsize.currentIndex());
emit fontChanged();
}
void NetHackQtSettings::resizeTiles() void NetHackQtSettings::resizeTiles()
{ {
int w = tilewidth.value(); int w = tilewidth.value();
int h = tileheight.value(); int h = tileheight.value();
settings.setValue("tilewidth", tilewidth.value());
settings.setValue("tileheight", tileheight.value());
theglyphs->setSize(w,h); theglyphs->setSize(w,h);
emit tilesChanged(); emit tilesChanged();
} }
+2
View File
@@ -33,6 +33,7 @@ public slots:
void setGlyphSize(bool); void setGlyphSize(bool);
private: private:
QSettings settings;
QSpinBox tilewidth; QSpinBox tilewidth;
QSpinBox tileheight; QSpinBox tileheight;
QLabel widthlbl; QLabel widthlbl;
@@ -48,6 +49,7 @@ private:
private slots: private slots:
void resizeTiles(); void resizeTiles();
void changedFont();
}; };
extern NetHackQtSettings* qt_settings; extern NetHackQtSettings* qt_settings;
+14 -17
View File
@@ -3837,7 +3837,8 @@ int *topsz, *bottomsz;
tty_status[NOW][idx].y = row; tty_status[NOW][idx].y = row;
tty_status[NOW][idx].x = col; tty_status[NOW][idx].x = col;
/* evaluate */ /* On a change to the field length, everything
further to the right must be updated as well */
if (tty_status[NOW][idx].lth != tty_status[BEFORE][idx].lth) if (tty_status[NOW][idx].lth != tty_status[BEFORE][idx].lth)
update_right = TRUE; update_right = TRUE;
@@ -4129,16 +4130,11 @@ render_status(VOID_ARGS)
for (i = 0; fieldorder[row][i] != BL_FLUSH; ++i) { for (i = 0; fieldorder[row][i] != BL_FLUSH; ++i) {
int fldidx = fieldorder[row][i]; int fldidx = fieldorder[row][i];
if (do_field_opt && !tty_status[NOW][fldidx].redraw) if (!status_activefields[fldidx])
continue;
/*
* Ignore zero length fields. check_fields() didn't count
* them in either.
*/
if (!tty_status[NOW][fldidx].lth && fldidx != BL_CONDITION)
continue; continue;
if (status_activefields[fldidx]) { if ((tty_status[NOW][fldidx].lth || fldidx == BL_CONDITION)
&& (tty_status[NOW][fldidx].redraw || !do_field_opt)) {
int coloridx = tty_status[NOW][fldidx].color; int coloridx = tty_status[NOW][fldidx].color;
int attridx = tty_status[NOW][fldidx].attr; int attridx = tty_status[NOW][fldidx].attr;
int x = tty_status[NOW][fldidx].x; int x = tty_status[NOW][fldidx].x;
@@ -4296,15 +4292,16 @@ render_status(VOID_ARGS)
End_Attr(attridx); End_Attr(attridx);
} }
} }
/* reset .redraw and .dirty now that they've been rendered */
tty_status[NOW][fldidx].dirty = FALSE;
tty_status[NOW][fldidx].redraw = FALSE;
/*
* Make a copy of the entire tty_status struct for comparison
* of current and previous.
*/
tty_status[BEFORE][fldidx] = tty_status[NOW][fldidx];
} }
/* reset .redraw and .dirty now that they've been rendered */
tty_status[NOW][fldidx].dirty = FALSE;
tty_status[NOW][fldidx].redraw = FALSE;
/*
* Make a copy of the entire tty_status struct for comparison
* of current and previous.
*/
tty_status[BEFORE][fldidx] = tty_status[NOW][fldidx];
} }
} }
if (cond_disp_width[NOW] < cond_width_at_shrink) { if (cond_disp_width[NOW] < cond_width_at_shrink) {