]> granicus.if.org Git - nethack/log
nethack
9 years agoGuidebook: #annotate, #overview
PatR [Mon, 30 Nov 2015 21:49:43 +0000 (13:49 -0800)]
Guidebook: #annotate, #overview

Another issue from old beta-tester mail:  #annotate and #overview were
missing from the list of extended commands.  M-A and M-O were listed
but marked "(if supported)" even though they've become unconditional.
Same for M-R, although in its case #ride wasn't missing.

9 years agoGuidebook: implicit_uncursed
PatR [Mon, 30 Nov 2015 20:59:17 +0000 (12:59 -0800)]
Guidebook: implicit_uncursed

Some old beta-tester mail suggested mentioning the implicit_uncursed
option in the "Curses and Blessings" section; this patch does that.
It also mentions that option in the "Configuring Menu Colors" section
since anyone trying to specify a color for " uncursed " will want
objects to be explicitly described as "uncursed".

The changes to the LaTeX version haven't been tested.  The generated
plain text version has a lot of spurious changes due to the padding
method it uses to right-justify short lines.

9 years agotribute: I Shall Wear Midnight
PatR [Mon, 30 Nov 2015 11:33:27 +0000 (03:33 -0800)]
tribute: I Shall Wear Midnight

9 years agodungeon overview bug fixes
PatR [Mon, 30 Nov 2015 05:46:24 +0000 (21:46 -0800)]
dungeon overview bug fixes

Reported by a beta tester months ago:  it was possible to recognize
your god's temple on the Astral Plane by stepping into its doorway,
since #overview would show "temple of <your god>" (only if just one
temple had been entered and the altar in it was the only one you'd
seen and it was for your own god; #overview doesn't show "temple of
<other god>", just "a temple").  After this fix it will just show
"a temple" even when you can see the temple's altar, so #overview
can't be used as a shortcut to finding the right temple.

While testing the fix I discovered that amnesia wasn't handled when
forgetting the current level's map, only when other levels got
flagged as forgotten.  The number of altars, fountains, and so on
are recalculated when #overview is executed, so current-level amnesia
worked for those.  But data about known rooms is not recalculated,
so the number of temples and shops you'd visited on the level stayed
instead of being forgotten.  The fix is a bit iffy for the case where
you only forget random spots scattered across the level's map rather
than the whole thing; this just wipes #overview memory of every room
even if parts of rooms are still remembered.

9 years agolexing updates (sys/unix/Makefile.utl)
PatR [Sat, 28 Nov 2015 11:46:33 +0000 (03:46 -0800)]
lexing updates (sys/unix/Makefile.utl)

Change the 'make' rules for *_lex.c, *_yacc.c, and *_comp.h to put
the end files names into whatever #line directives that refer to
the generated names (lex.yy.c, y.tab.c, y.tab.h).  This should not
produce any change in behavior during compilation except to provide
more accurate specifications of where any warnings or errors occur.

Add a 'make dist' target that copies generated scanner and parser
files to sys/share.  (As mentioned in the previous patch, I haven't
committed any of those since I have different versions of flex and
also of bison.)

9 years agolexer updates
PatR [Sat, 28 Nov 2015 11:38:03 +0000 (03:38 -0800)]
lexer updates

Bump the number of nodes (%e) specified in lev_comp.l so that the lex
on Solaris doesn't choke.  flex doesn't use those paramters (%e, %p,
and a few others), so this change gets accepted but hasn't been
adequately tested to verify that it solves the problem.

Reformat some of the C code at the end of dgn_comp.l and lev_comp.l;
going through the whole thing isn't worth the effort, particularly
since flex generates such a mess in the rest of the code it produces.

I haven't updated sys/share/*_lex.c and they definitely need it now.
I've got an older version of flex than the one that was used on the
code that's there now, and the most recent version.  Both of those
produce different code--the stuff that's there now has been through
more testing so whatever version was used for it ought to be used for
new editions.

9 years agoredo Guidebook.txt in ASCII text
PatR [Fri, 27 Nov 2015 08:44:26 +0000 (00:44 -0800)]
redo Guidebook.txt in ASCII text

9 years agoquest message summary debugging code
PatR [Thu, 26 Nov 2015 12:30:55 +0000 (04:30 -0800)]
quest message summary debugging code

How that there's nothing left to trigger it, put in some extra quest
messge debugging code.  Could be useful if new roles are added or if
any deliver-by-pline messages get changed to be deliver-by-window.

9 years agoquest message summaries: Val and Wiz
PatR [Thu, 26 Nov 2015 12:24:56 +0000 (04:24 -0800)]
quest message summaries: Val and Wiz

These are the last.  All the %Cc messages should now have one-line
summaries that can be stuffed into the ^P message history buffer.

9 years agotribute: Unseen Academicals
PatR [Thu, 26 Nov 2015 11:15:10 +0000 (03:15 -0800)]
tribute: Unseen Academicals

9 years agoquest message summaries: Rog, Sam, Tou
PatR [Thu, 26 Nov 2015 08:11:43 +0000 (00:11 -0800)]
quest message summaries: Rog, Sam, Tou

The samurai ones leave something to be desired since they make no
attempt to include Japanese terminology or to make sure the tone stays
appropriate to a samurai's honor.

9 years agodog/cat/rat/ape body parts
PatR [Thu, 26 Nov 2015 00:09:33 +0000 (16:09 -0800)]
dog/cat/rat/ape body parts

Another bit prompted by vibrating square testing:
 |You see a strange vibration beneath the little dog's rear claws.

Fix up some body parts:  dog, cat, and yeti-class (includes sasquatch,
monkey and ape, owlbear) already have "paws" instead of "fore claws".
Take away all 'Y' except owlbear from that list and add rodents to it.
Give them "rear paws" instead of "rear claws" for their feet; for legs,
use "foreleg" instead of "forelimb" and "read leg" instead of "rear limb".

For yeti/sasquatch/monkey/ape/carnivorous-ape, switch from paws to hands
since they have opposable thumbs, and switch to arm, leg, foot instead
of forelimb, rear limb, and rear claw.  I've left "fore claw" for finger.

9 years agotrap creation sanity check
PatR [Wed, 25 Nov 2015 22:56:58 +0000 (14:56 -0800)]
trap creation sanity check

Noticed while testing the look-at vs vibrating square patch:  I was
able to cover stairs with a trap via wizard mode wish.  That wish can
achieve a lot of irregular things, but prevent this particular one.

9 years agolook_at tweak
PatR [Wed, 25 Nov 2015 20:16:00 +0000 (12:16 -0800)]
look_at tweak

When examining a trap with '/' or ';', show
 |a trap (arrow trap)
instead of
 |a trap or a vibrating square (arrow trap)
outside of Gehennom (unless the trap actually is a vibrating square,
which could happen via wizard mode wish).  The extra verbosity is
distracting, and limiting mention of the vibrating square to the region
where it's relevant may give a hint to players getting that far for the
first time.

9 years agoMore fixes entries
Pasi Kallinen [Wed, 25 Nov 2015 11:01:34 +0000 (13:01 +0200)]
More fixes entries

9 years agoUpdate fixes to reflect multiple weakened farming strats
Pasi Kallinen [Wed, 25 Nov 2015 10:55:56 +0000 (12:55 +0200)]
Update fixes to reflect multiple weakened farming strats

9 years agotribute: Making Money
PatR [Wed, 25 Nov 2015 10:20:19 +0000 (02:20 -0800)]
tribute: Making Money

9 years agoMore tiny formatting fixes, move function names to start of line
Pasi Kallinen [Wed, 25 Nov 2015 08:15:41 +0000 (10:15 +0200)]
More tiny formatting fixes, move function names to start of line

9 years agoquest message summaries: Priest and Ranger
PatR [Tue, 24 Nov 2015 14:46:54 +0000 (06:46 -0800)]
quest message summaries: Priest and Ranger

9 years agoMore tiny formatting fixes
Pasi Kallinen [Tue, 24 Nov 2015 10:04:52 +0000 (12:04 +0200)]
More tiny formatting fixes

9 years agoPrevent kraken farming
Pasi Kallinen [Tue, 24 Nov 2015 09:35:45 +0000 (11:35 +0200)]
Prevent kraken farming

...or at least make it more inconvenient, by preventing fishy
creatures from revival by undead turning unless they're in a pool.

9 years agoFix infinite throne looting when confused
Pasi Kallinen [Tue, 24 Nov 2015 09:16:03 +0000 (11:16 +0200)]
Fix infinite throne looting when confused

This could be used to generate monsters ad infinitum.

9 years agoTiny formatting fix
Pasi Kallinen [Tue, 24 Nov 2015 07:59:20 +0000 (09:59 +0200)]
Tiny formatting fix

9 years agooverlay bit
PatR [Tue, 24 Nov 2015 00:00:50 +0000 (16:00 -0800)]
overlay bit

Advance declaration of a function that's passed as a pointer to another
function.

9 years agoAdd some hallu monsters
Pasi Kallinen [Mon, 23 Nov 2015 12:10:10 +0000 (14:10 +0200)]
Add some hallu monsters

9 years agoSYSCF WIZARDS
PatR [Mon, 23 Nov 2015 01:23:11 +0000 (17:23 -0800)]
SYSCF WIZARDS

Preformat SYSCF entry 'WIZARDS' so that it can be displayed during panic
feedback without allocating memory for the formatted list at that time.
It also gets displayed for help's "support information" ('?k').

For panic(), push "it may be possible to rebuild" to a second line since
the formatted usernames might make the line long.

9 years agobuild warning
PatR [Mon, 23 Nov 2015 01:21:44 +0000 (17:21 -0800)]
build warning

9 years agoflag panic() and terminate() as "no return"
PatR [Sun, 22 Nov 2015 16:33:42 +0000 (08:33 -0800)]
flag panic() and terminate() as "no return"

Mark panic() as never returning so that code analysis might be able
to do a smarter job.  It required splitting done() into two routines
since the first part really can return (but not if PANICKED was the
reason it got called).  done() is now much shorter and ends with a
call to new really_done(), and panic() skips done()'s might-return
part by calling really_done() directly.

Noticed in passing:  the "report error to <list of SYSCF WIZARDS>"
code calls a routine which uses alloc(), which won't work very well
if the reason for panic was because malloc() ran out of memory.

9 years agoavoid panic save panic if external compress fails
PatR [Sun, 22 Nov 2015 16:26:12 +0000 (08:26 -0800)]
avoid panic save panic if external compress fails

On OSX 10.5, save file compression and uncompression fail when I run
under debugger control (for gdb, at least; I don't know why).  I used
'#panic' to try something out.  panic() calls exit_nhwindows(), then
after some messages calls dosave0().  Saving calls docompress_file()
and when that fails on tty it tries to call clear_nhwindow(WIN_MESSAGE)
but WIN_MESSAGE has been torn down already, leading to a nested panic().
Avoid the call to clear_nhwindow() if windows aren't up.

9 years agovalgrind vs genl_putmixed
PatR [Sun, 22 Nov 2015 07:01:43 +0000 (23:01 -0800)]
valgrind vs genl_putmixed

In the midst of composing a commit message about how I reorganized some
of genl_putmixed()'s code without finding any problem, I realized that
there was a problem.  The character immediately after \G12345678 would
be copied directly to the output buffer without examination.  If that
was the leading backslash for a second encoded sequence, the G and the
hex digits would follow their backslash as just ordinary chars, which
is not what's intended.  Or if instead of a backslash the next character
was the input's terminating '\0', the latter would be copied into the
output and the pointer to the input string would be incremented, then
the next loop iteraction would examined whatever followed.  If valgrind
is smart enough--and it seems to be--it would complain about accessing
a character that putmixed()'s caller hadn't initialized.

The only use of putmixed() I'm sure about is the what-is code showing
a screen symbol with its explanation, which doesn't exercise either
\G12345678\G12345678 or \G12345678\0.  I didn't go hunting to see if
there was someplace that might have an encoded symbol at the end of the
string.  what-is still works after this patch....

The only substantive change is adding ``continue'' but I haven't gone
back and undone the reorg that preceded it.

9 years agoPacify some clang compile warnings, pt 2
Pasi Kallinen [Sat, 21 Nov 2015 21:50:11 +0000 (23:50 +0200)]
Pacify some clang compile warnings, pt 2

9 years agoPacify some clang compile warnings
Pasi Kallinen [Sat, 21 Nov 2015 21:40:06 +0000 (23:40 +0200)]
Pacify some clang compile warnings

9 years agoDeclare a variable as static
Pasi Kallinen [Sat, 21 Nov 2015 18:56:47 +0000 (20:56 +0200)]
Declare a variable as static

9 years agoRemove useless variable
Pasi Kallinen [Sat, 21 Nov 2015 18:51:46 +0000 (20:51 +0200)]
Remove useless variable

9 years agoDeclare missing function proto
Pasi Kallinen [Sat, 21 Nov 2015 18:47:31 +0000 (20:47 +0200)]
Declare missing function proto

9 years agoDeclare polearm range variables as static
Pasi Kallinen [Sat, 21 Nov 2015 18:25:05 +0000 (20:25 +0200)]
Declare polearm range variables as static

9 years ago remove duplicate assignment
PatR [Sat, 21 Nov 2015 14:52:29 +0000 (06:52 -0800)]
remove duplicate assignment

    Introduced with some reformatting a couple of days ago, t1->uid is
    already given a value two lines above.

9 years agofix more clang complaints
PatR [Sat, 21 Nov 2015 08:25:50 +0000 (00:25 -0800)]
fix more clang complaints

Fix some more of the complaints from clang's static analyzer.  The one
in options.c (manipulating warnings symbols) appears to be an actual bug.
All the rest are either because the analysis isn't quite sophicated
enough or outright bogus.

Two of them appear to be because a static routine is attempting to guard
against callers in the same file failing to pass in required output
pointers.  Stripping away the check for missing pointer should convince
the analyzer that those output parameters always receive a value.  We'll
see once the analysis is eventually re-run....

9 years agolev_main cleanup
PatR [Sat, 21 Nov 2015 02:58:48 +0000 (18:58 -0800)]
lev_main cleanup

Use an alternate fix for the complaint from clang's static analyzer
(about potentially derefencing a null pointer, which can't happen
here because alloc() panics and quits rather than return Null), plus
some reformatting and removal of a chunk of unused code (strncmpi).

Also a formatting bit for lev_comp.y, making sys/share/lev_yacc.c
be out of date.  However, the generated code will be the same--except
for line numbers--so this shouldn't inhibit anybody's planned testing
waiting for the generated copy to be updated.

9 years agovalgrind trap complaint
PatR [Sat, 21 Nov 2015 02:31:17 +0000 (18:31 -0800)]
valgrind trap complaint

I think this should fix one of the valgrind complaints.  Traps which
didn't use the trap->vl union field never initialized it, leaving a
bit of random garbage in the malloc'd trap structure.  (And traps
which overwrote existing ones that did use it didn't reinitialize it
so kept stale data around.)  Since those fields weren't in use by
the traps that don't care about them, this didn't provoke any actual
trouble.

Also reformatting....

9 years agoFix segfault if lev_comp could not alloc memory for opcode
Pasi Kallinen [Fri, 20 Nov 2015 10:27:46 +0000 (12:27 +0200)]
Fix segfault if lev_comp could not alloc memory for opcode

9 years agomore warning suppression
PatR [Fri, 20 Nov 2015 10:00:31 +0000 (02:00 -0800)]
more warning suppression

This should avoid two of the three bogus clang complaints about
retaining the address of a stack variable after it has gone out of
scope.

Plus a recreation of some formatting I did a while back and then
accidentally clobbered before committing.

9 years agonmake Makefile updates
nhmall [Fri, 20 Nov 2015 04:12:20 +0000 (23:12 -0500)]
nmake Makefile updates

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
nhmall [Fri, 20 Nov 2015 03:45:29 +0000 (22:45 -0500)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

9 years agonmake output status messages
nhmall [Fri, 20 Nov 2015 03:35:49 +0000 (22:35 -0500)]
nmake output status messages
 Changes to be committed:
modified:   sys/winnt/Makefile.msc

I've noticed odd output from some of the echo statements
used in the Microsoft nmake Makefile before, but never
bothered to investigate why.

Pat observed that it was due to conversion of \t
in the path that resulted from expansion of the target
macro $@

This change uses the macro character substitution
feature to convert the back slashes to forward slashes
in the message, making the quirky conversion go away.

9 years agowarning suppression
PatR [Fri, 20 Nov 2015 02:49:50 +0000 (18:49 -0800)]
warning suppression

Fix a couple of the clang static analyzer's warnings.

muse.c has some reformatting.  zap.c wasn't triggering any warning about
possible null pointer, but using MON_AT() to maybe avoid m_at() is not
a useful optimization since m_at() is a macro which starts out by using
MON_AT() itself.

9 years agoanother typo
nhmall [Fri, 20 Nov 2015 00:36:14 +0000 (19:36 -0500)]
another typo

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
nhmall [Fri, 20 Nov 2015 00:29:55 +0000 (19:29 -0500)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

9 years agotypo fix and some elaboration
nhmall [Fri, 20 Nov 2015 00:28:39 +0000 (19:28 -0500)]
typo fix and some elaboration
 Changes to be committed:
modified:   sys/winnt/Install.nt

9 years agobuilt warning for STATUS_VIA_WINDOWPORT
PatR [Fri, 20 Nov 2015 00:18:12 +0000 (16:18 -0800)]
built warning for STATUS_VIA_WINDOWPORT

This should fix one of the 64-bit warnings.  Make the conversion from
ptrdiff_t to int be explicit with a cast.

9 years agoWindows build updates
nhmall [Thu, 19 Nov 2015 23:57:17 +0000 (18:57 -0500)]
Windows build updates

9 years agoWindows x64 Makefile build work
nhmall [Thu, 19 Nov 2015 12:58:58 +0000 (07:58 -0500)]
Windows x64 Makefile build work

9 years agoundo unintended default build architecture change
nhmall [Thu, 19 Nov 2015 04:12:39 +0000 (23:12 -0500)]
undo unintended default build architecture change
 Changes to be committed:
modified:   sys/winnt/Makefile.msc

Previous patch altered more than intended.

9 years agoEnsure VS2013 64-bit compiler drops to warning level -W3
nhmall [Thu, 19 Nov 2015 03:41:30 +0000 (22:41 -0500)]
Ensure VS2013 64-bit compiler drops to warning level -W3

This doesn't fix the cppregex.cpp issue. This just eliminates
about 10,000 warnings.

9 years agosysconf update
PatR [Thu, 19 Nov 2015 02:07:35 +0000 (18:07 -0800)]
sysconf update

Add missing 'sysconf' to sys/unix/ and sys/winnt/ sections of Files.

Update sys/unix/sysconf; I started out just to remove the duplicate
DEBUGFILES entry but ended up expanding several of the comments too.

Also, fix a typo in the vms build/install instructions.

9 years agoMerge branch 'master' into mac-build-tty-pkg
Haoyang Wang [Wed, 18 Nov 2015 21:23:35 +0000 (13:23 -0800)]
Merge branch 'master' into mac-build-tty-pkg

9 years agoFix some warnings from clang's static code analyzer
Pasi Kallinen [Wed, 18 Nov 2015 20:54:28 +0000 (22:54 +0200)]
Fix some warnings from clang's static code analyzer

9 years agoX11 pilemark.xbm
PatR [Wed, 18 Nov 2015 11:04:35 +0000 (03:04 -0800)]
X11 pilemark.xbm

Update the unix Makefiles and the older OSX hints files to handle the
pile marker tile overlay.  I didn't touch hints/macosx10.10 and .11
since I think there's still a merge for them pending.

A couple of formatting tweaks for bemain.c are included, for no
compelling reason.  What are the odds that anyone will every build
that again?

9 years ago fix for pre-ANSI compilers
PatR [Wed, 18 Nov 2015 08:45:03 +0000 (00:45 -0800)]
fix for pre-ANSI compilers

    Declare a function pointer without requiring support for prototypes.
Plus a couple of formatting tidbits.

9 years agounix/Makefile.utl typo
PatR [Tue, 17 Nov 2015 11:09:20 +0000 (03:09 -0800)]
unix/Makefile.utl typo

Confusing build failure, explained by a typo in sys/unix/Makefile.utl.
dgn_lex.o didn't get rebuilt after modifying unixconf.h to take out
the #define MONITOR_HEAP I had in place, resulting in link failure for
dgn_comp because the old object file was referencing 'nhalloc' rather
than 'alloc'.  dgn_lex.o accidentally didn't care about modifications
to config.h and the other headers that pulls in, such as unixconf.h.

This typo was already present when the last cvs repository was
initialized nearly 14 years ago.

9 years agotribute: Wintersmith
PatR [Tue, 17 Nov 2015 10:47:05 +0000 (02:47 -0800)]
tribute: Wintersmith

9 years agoinclude/*.h formatting
PatR [Tue, 17 Nov 2015 10:26:17 +0000 (02:26 -0800)]
include/*.h formatting

I tracked down the widest lines, which sometimes occur due to mis-indent
of block comments (see tradstdc.h for an example), and fixed those up.
For the files affected, I also converted tabs to spaces.

9 years agodisplay.h reformatting
PatR [Tue, 17 Nov 2015 02:57:11 +0000 (18:57 -0800)]
display.h reformatting

A couple of macros with comments in the midst of their expansions got
badly mangled by the automated reformat and one ended up with a line
that was over 150 characters wide.

9 years agoupdate config.h
PatR [Tue, 17 Nov 2015 02:55:15 +0000 (18:55 -0800)]
update config.h

Some reformatting (replacing tabs with spaces), but mostly updating some
of the comments, particularly about SYSCF.

Shouldn't GENERIC_USERNAMES be controllable via SYSCF?

9 years agoComment typofix
Pasi Kallinen [Mon, 16 Nov 2015 09:46:45 +0000 (11:46 +0200)]
Comment typofix

9 years agoUpdate Guidebook.txt
Pasi Kallinen [Mon, 16 Nov 2015 08:24:16 +0000 (10:24 +0200)]
Update Guidebook.txt

9 years agotribute enhancement
PatR [Mon, 16 Nov 2015 05:57:15 +0000 (21:57 -0800)]
tribute enhancement

When reading a novel, select a random passage which hasn't been shown
already.  Once you've run through all the passages, it resets to get
them all again (with new random order that might happen to the be same
order if there aren't many passages).  Switching to a different novel--
even another copy of the same one--will cause the previous passage
selection to be discarded and restarted from scratch if the prior book
is read again.  Passage tracking for the most recently read novel is
kept across save and restore.  (That means I needed to bump EDITLEVEL,
so it will need to be reset to 0 again before release.)

9 years agotribute: Thud!
PatR [Mon, 16 Nov 2015 01:00:08 +0000 (17:00 -0800)]
tribute: Thud!

9 years agotty_exit_nhwindows
PatR [Sun, 15 Nov 2015 23:35:48 +0000 (15:35 -0800)]
tty_exit_nhwindows

Keep window bookkeeping up to date when tty interface is shuting down.

The other interfaces should do something similar when they make windows
known to the core become unavailable.

9 years agoFix use of data from deleted vault teleport trap
Pasi Kallinen [Sun, 15 Nov 2015 16:55:09 +0000 (18:55 +0200)]
Fix use of data from deleted vault teleport trap

9 years agowindow cleanup at exit
PatR [Sun, 15 Nov 2015 08:32:56 +0000 (00:32 -0800)]
window cleanup at exit

exit_nhwindows() is called before terminate(), and the tty incarnation
destroys all windows--including 'pickinv_cache_win'--without setting
the various index variables used to access them to WIN_ERR, then
terminate() calls freedynamicdata() which calls free_pickinv_cache()
which tries to destroy 'pickinv_cache_win' since it isn't WIN_ERR (if
the perm_invent option has been enabled during that playing session).
Some of the other <interface>_exit_nhwindows() also tear things down
without resetting the variables used to track them, so fixing this in
exit_nhwindows() would have been pretty messy.

Call free_pickinv_cache() before exit_nhwindows() in done().  At the
moment it's only called from done(), so other exit paths won't release
the small chunk(s) of memory used for the alternate inventory window
(if it got created for perm_invent support).

9 years agoUpdate precompiled lev_comp lex and yacc files
Pasi Kallinen [Sun, 15 Nov 2015 07:09:45 +0000 (09:09 +0200)]
Update precompiled lev_comp lex and yacc files

9 years agoExtract guard gold before disposing it
Pasi Kallinen [Sat, 14 Nov 2015 15:41:27 +0000 (17:41 +0200)]
Extract guard gold before disposing it

If the gold is still in monster inventory, dealloc_obj will panic.

9 years agoreadobjnam()'s "overlapping strcat"
PatR [Sat, 14 Nov 2015 08:46:19 +0000 (00:46 -0800)]
readobjnam()'s "overlapping strcat"

Replace the code that uses strcat with two pointers into the same buffer.
Treated separately, they point at distinct strings (no overlap possible),
but the C standard does disallow that in order to enable optimizations
using block transfer or such, so the tool that complained about it isn't
wrong.  The characters getting appended to the output pointer can end
up overlapping the beginning of the other input pointer, conceivably
breaking an implementation that didn't use simple left-to-right byte-at-
a-time copying.

Also, I noticed that wishing for "luck stone" gave me a random gem.
There's code to strip off " stone" and compare against gem types, but it
prevents other code that accepts "foo bar" as a match for "foobar" and
vice versa from finding a match, since "luck" doesn't match anything
once "stone" is gone.  So add the four gray stones into the array of
alternate spellings.

Another bit:  it now accepts " gem" in addition to " stone" as optional
gem suffix, so "ruby", "ruby stone", and "ruby gem" all yield ruby.
("luck gem" won't work; you'll end up with a random gem-class object.)

And a last other bit:  wishing for "lamp (lit) named foo" would yield
an unlit, unnamed lamp because "(lit)" followed by anything didn't match
"(lit)" and threw away everything past the opening paren.  Now it will
produce "lamp named foo (lit)"--a lit lamp named "foo".  (Wishing for
"lamp named foo (lit)" produces an unlit lamp named "foo (lit)".  That's
acceptable to me... I'm not crawling any farther down this hole.  Maybe
object formatting should be changed to keep the lit attribute in front
of the name?)

9 years agoRemove the useless FUN STUFF section
Pasi Kallinen [Sat, 14 Nov 2015 08:29:44 +0000 (10:29 +0200)]
Remove the useless FUN STUFF section

The fun stuff section in config.h contains nothing fun anymore,
so let's remove it. Move SCORE_ON_BOTL to the next section,
and add couple other defines there too.

9 years agoFix enexto complaint when morguemon returned null
Pasi Kallinen [Sat, 14 Nov 2015 07:59:35 +0000 (09:59 +0200)]
Fix enexto complaint when morguemon returned null

9 years agofix memory leak: obj->oextra->omonst->mextra
PatR [Sat, 14 Nov 2015 04:39:10 +0000 (20:39 -0800)]
fix memory leak: obj->oextra->omonst->mextra

The memory leak (monst->mextra->edog, monst->mextra->mname,
monst->mextra for some monster were not released) I noticed recently
was due to recording a pet's full monster attributes with its corpse.
During save and restore, obj->oextra->omonst was being treated as a
full-fledged monster so worked as intended, but when freed, omonst
was treated as a black box and its mextra details weren't handled.

9 years agosuppress an MSC warning in cppregex.cpp
nhmall [Fri, 13 Nov 2015 14:14:50 +0000 (09:14 -0500)]
suppress an MSC warning in cppregex.cpp
 Changes to be committed:
modified:   include/ntconf.h

9 years agotty build warning
PatR [Fri, 13 Nov 2015 09:12:43 +0000 (01:12 -0800)]
tty build warning

Use casts to try to suppress a couple of assignments of long to short
that Michael's compiler warns about.  'cw->maxrow' might have a value
that's too big for 'short' (when dealing with really big menus), but
'cw->maxcol' never will (unless someone comes up with a terminal or
emulator that's wider that 32K-1 characters...).

9 years agoClear thrownobj when punished and swallowed
Pasi Kallinen [Thu, 12 Nov 2015 22:07:43 +0000 (00:07 +0200)]
Clear thrownobj when punished and swallowed

As per Pat's suggestion, this actually does work correctly;
I have no idea why I thought it didn't ...

9 years agoFix hiding under nothing when corpse rotted away
Pasi Kallinen [Thu, 12 Nov 2015 22:06:07 +0000 (00:06 +0200)]
Fix hiding under nothing when corpse rotted away

9 years agoPrevent buffer overflow
Pasi Kallinen [Thu, 12 Nov 2015 20:01:47 +0000 (22:01 +0200)]
Prevent buffer overflow

9 years agoPrevent a rnd(0) call
Pasi Kallinen [Thu, 12 Nov 2015 18:11:45 +0000 (20:11 +0200)]
Prevent a rnd(0) call

9 years agoFix wallification and wallify catacombs mine end
Pasi Kallinen [Thu, 12 Nov 2015 16:29:33 +0000 (18:29 +0200)]
Fix wallification and wallify catacombs mine end

9 years agoFix special level loader memory leaks
Pasi Kallinen [Thu, 12 Nov 2015 16:00:55 +0000 (18:00 +0200)]
Fix special level loader memory leaks

9 years agotribute: Going Postal
PatR [Thu, 12 Nov 2015 09:47:04 +0000 (01:47 -0800)]
tribute: Going Postal

9 years agomake depend
PatR [Thu, 12 Nov 2015 07:46:19 +0000 (23:46 -0800)]
make depend

dungeon.o depending on lev.h is the only change found by 'make depend'.
(I'm a bit suspicious about that.)

I haven't attempted to reconcile the vms Makefiles with the Unix ones,
just put in this one new dependency.  I know vms/Makefile.src lacks
handling for sys/share/*regex.c and vms/Makefile.top and install.com
both lack handling for 'sysconf'.

9 years agosrc/objects.c formatting
PatR [Thu, 12 Nov 2015 07:30:59 +0000 (23:30 -0800)]
src/objects.c formatting

Fit the new comments within 80 (actually 78) columns.

9 years agofix PATCHLEVEL
PatR [Thu, 12 Nov 2015 06:56:57 +0000 (22:56 -0800)]
fix PATCHLEVEL

> Somebody has changed versioning so that the game incorrectly states
> 3.6.1 in messages. It looks like someone updated patchlevel instead of
> editlevel?

Yes, that was me.  I meant to increment EDITLEVEL and nobody noticed
the mistake until now....

This changes PATCHLEVEL back to the correct value of 0, and implicitly
resets EDITLEVEL to 0 for release (by not changing it to 1 as it was
supposed to have been for the past 3-4 weeks).

Data files from Oct. 18 through today are actually compatible but will
be rejected once anyone rebuilds with this fix, same as would happen
when EDITLEVEL changs.  Data files from before Oct. 18 will be
incompatible but be accepted by nethack but not work correctly due to
a change in the 'context' structure.

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
nhmall [Thu, 12 Nov 2015 05:52:35 +0000 (00:52 -0500)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

9 years agoRepair recent tile mapping error when MAIL is undefined
nhmall [Thu, 12 Nov 2015 05:42:52 +0000 (00:42 -0500)]
Repair recent tile mapping error when MAIL is undefined
 Changes to be committed:
modified:   src/objects.c
modified:   win/share/tilemap.c

Warnings during tile builds (and incorrect tile mappings
at run time when MAIL wasn't defined):
Creating 16x16 binary tile files (this may take some time)
warning: for tile 325 (numbered 325) of objects.txt,
        found 'ETAOIN SHRDLU' while expecting 'stamped / mail'
warning: for tile 326 (numbered 326) of objects.txt,
        found 'LOREM IPSUM' while expecting 'ETAOIN SHRDLU'

The recent addition of the first new extra scroll descriptions in a
very long time caused this problem to show up when MAIL was undefined.

There was a magic number in use that made an assumption that there
were only 4 such extra scroll descriptions, those being
"FOOBIE BLETCH", "TEMOV","GARVEN DEH","READ ME"

9 years agoFix infinite looping when bound digging on solid map
Pasi Kallinen [Wed, 11 Nov 2015 19:47:51 +0000 (21:47 +0200)]
Fix infinite looping when bound digging on solid map

9 years agounused parameter warning and an invalid index
nhmall [Wed, 11 Nov 2015 14:57:05 +0000 (09:57 -0500)]
unused parameter warning and an invalid index
 Changes to be committed:
modified:   win/tty/wintty.c

9 years agoWindows 10
nhmall [Wed, 11 Nov 2015 14:20:19 +0000 (09:20 -0500)]
Windows 10

9 years agoWindows 10
nhmall [Wed, 11 Nov 2015 14:19:06 +0000 (09:19 -0500)]
Windows 10
 Changes to be committed:
modified:   README

 Changes not staged for commit:
modified:   sys/winnt/Install.nt

9 years agotty memory management at program termination
PatR [Wed, 11 Nov 2015 09:43:03 +0000 (01:43 -0800)]
tty memory management at program termination

Release some dynamically allocated memory prior to exit.  These were
previously left alone due to assumed complexity (at least by me...),
but dealing with them turned out to be straightforward.

|#if FREE_ALL_MEMORY
 free BASE_WINDOW  -- tty-specific; other windows are drawn on top of it
 free ttyDisplay   -- tty's basic data structure
|#endif
 free nh_HI, nh_HE -- termcap values handled differently from the rest

These are the last things that 'heaputil' always reported as not freed
for the basic Unix+tty configuration.  (I've observed other things not
being freed; those are post-3.4.3 bugs that need to be found and fixed.)

9 years agodoset() -> special_handling() -> free(NULL)
PatR [Wed, 11 Nov 2015 09:28:04 +0000 (01:28 -0800)]
doset() -> special_handling() -> free(NULL)

This isn't urgent, but I figure that until the mac build stuff gets
merged in, the core is still fair game....

'O' command's autopickup_exceptions was freeing a menu pick-list even
when it hadn't been allocated (for the list case, and for the remove
case if nothing was chosen for removal).  That code was evidently used
as the model for msgtype and menucolors; they had the same situation.

I think ANSI and ISO sanction free(NULL) as a no-op, but pre-ANSI free
implementations don't necessarily handle that benignly.  Even if they
all do, freeing something--even if that 'something' is nothing--which
hasn't been allocated is a bug on our end.

9 years agoadd Windows info
keni [Tue, 10 Nov 2015 18:27:32 +0000 (13:27 -0500)]
add Windows info

9 years agoAdd the DEVEL tree to Files.
keni [Tue, 10 Nov 2015 14:44:21 +0000 (09:44 -0500)]
Add the DEVEL tree to Files.

9 years agoREADME and dat/history update
PatR [Tue, 10 Nov 2015 09:49:21 +0000 (01:49 -0800)]
README and dat/history update

README - add VMS back as a tested platform; thanks KevinS!
dat/history - add VMS update, remove trailing whitespace, two spaces;
  instead of just one (recently added stuff) for sentence separation;
sys/vms/Install.vms - minimal update;
Files - reformat the win32 project section to fit within 80 columns.