From 4c9f4dbbd937bea1bccfa692bebdfcd873b9c4dc Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 2 Nov 2019 11:40:12 +0200 Subject: [PATCH 1/3] Prevent leashing monsters with no extremities ... and also unsolid monsters. --- doc/fixes36.3 | 1 + src/apply.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 4738aa857..df3a55a30 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -211,6 +211,7 @@ wizmakemap could leave genocided monsters on map when entering Astral level, initial rendering of guardian angel didn't show it as tame; noticeable if the level was entered with 'hilite_pet' On fix a leashed pet polymorphed into a long worm staying leashed +prevent leashing unsolid monsters and monsters with no extremities Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/src/apply.c b/src/apply.c index 96f9469b6..6c135f110 100644 --- a/src/apply.c +++ b/src/apply.c @@ -591,15 +591,13 @@ unleash_all() #define MAXLEASHED 2 -/* TODO: - * This ought to exclude various other things, such as lights and gas - * spore, is_whirly() critters, ethereal creatures, possibly others. - */ boolean leashable(mtmp) struct monst *mtmp; { - return (boolean) (mtmp->mnum != PM_LONG_WORM); + return (boolean) (mtmp->mnum != PM_LONG_WORM + && !unsolid(mtmp->data) + && (!nolimbs(mtmp->data) || has_head(mtmp->data))); } /* ARGSUSED */ @@ -671,6 +669,11 @@ struct obj *obj; if (mtmp->mleashed) { pline("This %s is already leashed.", spotmon ? l_monnam(mtmp) : "creature"); + } else if (unsolid(mtmp->data)) { + pline("The leash would just fall off."); + } else if (nolimbs(mtmp->data) && !has_head(mtmp->data)) { + pline("%s has no extremities the leash would fit.", + Monnam(mtmp)); } else if (!leashable(mtmp)) { pline("The leash won't fit onto %s%s.", spotmon ? "your " : "", l_monnam(mtmp)); From c66eb915d29ec303c558de9054e26db36a73cbf5 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 2 Nov 2019 03:32:35 -0700 Subject: [PATCH 2/3] Guidebook.mn Symbols section The table listing symset entries was ok for ps/pdf output but for plain text output it was wrapping to a second line for S_xan, S_pet_override, and S_player_override and also going past the right margin for some others. I've shortened the text for those three and narrowed the first column to give more room for the third column, bringing all the lines within their margin. The entry for S_stone was rather surprising: "dark part of a room". It now says "solid rock or unexplored terrain or dark part of a room" and needed to span two lines. The first column has been labeled "Default" but that was why that column was wider than necessary. It now has a label of two spaces and is left justified instead of being centered. It is also now forcing constant-width Roman as the font and every character in that column should be the same size so one reason for centering is removed. The title used to be centered but always looked a bit off due to the fact that the three columns have differing widths and/or because of the over-wide lines changing the location of "center". It is now left justified and looks a little bit like it's labeling the first column. Perhaps it needs a blank line separating it from the rest. Guidebook.tex is lagging again. --- doc/Guidebook.mn | 48 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index aec017528..b4c37dc6f 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1,4 +1,4 @@ -.\" $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.319 $ $NHDT-Date: 1572525093 2019/10/31 12:31:33 $ +.\" $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.324 $ $NHDT-Date: 1572690738 2019/11/02 10:32:18 $ .\" .\" This is an excerpt from the 'roff' man page from the 'groff' package. .\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines. @@ -4408,16 +4408,23 @@ The special prefix form \\m switches on the meta bit in the symbol value, and the \(ha prefix causes the following character to be treated as a control character. .pg +.\" Table is centered. +.\" First line (title) is left justified and spans second and third columns; +.\" it used to be centered but tended to look as if too far to the right. +.\" Remaining lines are left justified in each of three columns. First +.\" line (second overall) contains column labels; the first column has a +.\" dummy label of two spaces. (That used to be "Default" but it made all +.\" the lines wider because of the label's width and caused several lines +.\" to be too wide when generating plain text output. Two spaces leaves +.\" some room between the symbol character and name.) Entries in first +.\" column now use constant-width Roman font to approximate TeX tt font. .TS S center; -c s s -c1 l1 l. +l s s +l1fCR l1 l. .\"TABLE_START -.\" because description is wide, centered title seems off, so pad it a bit -.\" note that each backslash precedes one space of padding (including the -.\" last one; in other words, there's a trailing space here) -NetHack Symbols\ \ \ \ \ \ \ -Default Symbol Name Description +NetHack Symbols +\ \ Symbol Name Description \_ \_ \_ \ S_air (air) \&_ S_altar (altar) @@ -4544,7 +4551,8 @@ s S_spider (arachnid or centipede) @ S_ss3 (magic shield 3 of 4) * S_ss4 (magic shield 4 of 4) \(ha S_statue_trap (statue trap) -\ S_stone (dark part of a room) +\ S_stone (solid rock or unexplored terrain +\ \ \ or dark part of a room) ] S_strange_obj (strange object) \- S_sw_bc (swallow bottom center) \\ S_sw_bl (swallow bottom left) @@ -4588,15 +4596,28 @@ v S_vortex (vortex) w S_worm (worm) \(ti S_worm_tail (long worm tail) W S_wraith (wraith) -x S_xan (xan or other mythical/fantastic insect) +x S_xan (xan or other extraordinary insect) X S_xorn (xorn) Y S_yeti (apelike creature) Z S_zombie (zombie) z S_zruty (zruty) -\ S_pet_override (any pet if sysconf accessibility is set) -\ S_player_override (hero if sysconf accessibility is set) +\ S_pet_override (any pet if ACCESSIBILITY=1 is set) +\ S_player_override (hero if ACCESSIBILITY=1 is set) .\"TABLE_END Do not delete this line. .TE +.\" don't hyphenate file name across lines +.hw sysconf +.pg +Notes: several symbols in this table appear to be blank. They are the +space character, except for S_pet_override and S_player_override which +don't have any default value and can only be used if enabled in the +\(lqsysconf\(rq file. +.pg +S_rock is misleadingly named; rocks and stones use S_gem. +Statues and boulders are the rock being referred to, but since +version 3.6.0, statues are displayed as the monster they depict. +So S_rock is only used for boulders and not used at all if +overridden by the more specific S_boulder. .pg .hn 2 Configuring NetHack for Play by the Blind @@ -4643,7 +4664,8 @@ See the previous section for the special symbols S_pet_override to force a consistent symbol for all pets and S_player_override to force a unique symbol for the player character if \fBaccessibility\fP is enabled in the sysconf file. -The most crucial settings to make the game accessible are: +.pg +The most crucial settings to make the game more accessible are: .pg .lp symset:NHAccess Load a symbol set appropriate for use by blind players. From 35fc46e3ebfbe87eff7112e9ed48d8f60d6c4f55 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 2 Nov 2019 09:23:34 -0400 Subject: [PATCH 3/3] missing constants on mingw build fix Errors seen during build: o/windmain.o:windmain.c:(.rdata$.refptr.FOLDERID_ProgramData[.refptr.FOLDERID_ProgramData]+0x0): undefined reference to `FOLDERID_ProgramData' o/windmain.o:windmain.c:(.rdata$.refptr.FOLDERID_LocalAppData[.refptr.FOLDERID_LocalAppData]+0x0): undefined reference to `FOLDERID_LocalAppData' o/windmain.o:windmain.c:(.rdata$.refptr.FOLDERID_Profile[.refptr.FOLDERID_Profile]+0x0): undefined reference to `FOLDERID_Profile' collect2.exe: error: ld returned 1 exit status mingw32-make: *** [Makefile:849: ../binary/NetHack.exe] Error 1 DEFINE_KNOWN_FOLDER is using this particular definition in the mingw header files: rather than this one: So, the known folder values that recent code is using such as FOLDERID_ProgramData, FOLDERID_LocalAppData, and FOLDERID_Profile are being declared as external constants. That is why the error is a link error. We need to include -luuid on the link command line because those external constants are defined in uuid.lib. --- sys/winnt/Makefile.gcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/winnt/Makefile.gcc b/sys/winnt/Makefile.gcc index 0dce1f176..54a14572e 100644 --- a/sys/winnt/Makefile.gcc +++ b/sys/winnt/Makefile.gcc @@ -510,7 +510,7 @@ endif CFLAGSBASE = -c $(cflags) $(WINPINC) $(cdebug) $(CURSESDEF) #LFLAGSBASEC = $(linkdebug) #LFLAGSBASEG = $(linkdebug) -mwindows -baselibs = -lwinmm -lshell32 -lole32 +baselibs = -lwinmm -lshell32 -lole32 -luuid conlibs = -lgdi32 $(baselibs) $(BCRYPT) guilibs = -lcomctl32 $(baselibs) ifeq "$(WANT_WIN_QT4)" "Y"