]> granicus.if.org Git - nethack/log
nethack
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.

9 years agooptions.c cleanup
PatR [Tue, 10 Nov 2015 03:20:19 +0000 (19:20 -0800)]
options.c cleanup

Replace several 'foo = alloc(strlen(bar)+1), strcpy(foo,bar)' sequences
  with 'foo = dupstr(bar)' calls.
Change 'free(foo)' into 'free((genericptr_t) foo)' to possibly pacify
  'lint' and/or really old compilers.
Add braces around 'if something;' when 'else { otherwise; }' has braces.
Simplify option value formatting for 'sortloot'.

9 years agotiny symset memory leak
PatR [Tue, 10 Nov 2015 03:11:41 +0000 (19:11 -0800)]
tiny symset memory leak

Symbol set names weren't being freed upon exit.

9 years agoupdate util/.gitignore
PatR [Tue, 10 Nov 2015 02:37:00 +0000 (18:37 -0800)]
update util/.gitignore

Tell git to ignore the presence of the heaputil program in util/.
(It lives in NHinternal/devteam/util/heaputil.c but working with it
from there is inconvenient.)

9 years agoSYSCF tiny memory leak
PatR [Tue, 10 Nov 2015 01:21:20 +0000 (17:21 -0800)]
SYSCF tiny memory leak

Free sysopt.shellers and sysopt.explorers when releasing the memory used
for other sysopt fields.

Also some formatting stuff since sys.c was previously untouched.

9 years agoWhen build_tty_pkg, include the sysconf with mac-specific changes
Haoyang Wang [Mon, 9 Nov 2015 21:59:14 +0000 (13:59 -0800)]
When build_tty_pkg, include the sysconf with mac-specific changes

9 years agoUnify blind feel_location or newsym info single func
Pasi Kallinen [Mon, 9 Nov 2015 19:37:28 +0000 (21:37 +0200)]
Unify blind feel_location or newsym info single func

9 years agoUnwrap t-shirt and apron texts, and add one t-shirt msg
Pasi Kallinen [Mon, 9 Nov 2015 11:24:40 +0000 (13:24 +0200)]
Unwrap t-shirt and apron texts, and add one t-shirt msg

9 years agoRemove trailing whitespaces
Pasi Kallinen [Mon, 9 Nov 2015 11:06:19 +0000 (13:06 +0200)]
Remove trailing whitespaces

9 years agofix makedefs
PatR [Mon, 9 Nov 2015 09:47:18 +0000 (01:47 -0800)]
fix makedefs

If makedefs.c is compiled with MONITOR_HEAP defined, attempted calls to
free() resulted in link failure.  Since makedefs doesn't use alloc(),
call free() directly instead of redirecting to nhfree().

Also some assorted reformatting....

9 years agouse pstopdf to generate Guidebook.pdf
Haoyang Wang [Mon, 9 Nov 2015 08:04:31 +0000 (00:04 -0800)]
use pstopdf to generate Guidebook.pdf

9 years agopilemark.xbm
Haoyang Wang [Sat, 7 Nov 2015 01:51:48 +0000 (17:51 -0800)]
pilemark.xbm

9 years agoX11 include and lib
Haoyang Wang [Mon, 2 Nov 2015 20:17:40 +0000 (12:17 -0800)]
X11 include and lib

9 years agoalso touch logfile
Haoyang Wang [Mon, 2 Nov 2015 19:58:08 +0000 (11:58 -0800)]
also touch logfile

9 years agoremove macosx10.11 because macosx10.10 works on both .10 and .11
Haoyang Wang [Mon, 2 Nov 2015 19:29:08 +0000 (11:29 -0800)]
remove macosx10.11 because macosx10.10 works on both .10 and .11

9 years agodefault to WANT_SHARE_INSTALL off
Haoyang Wang [Mon, 2 Nov 2015 19:20:18 +0000 (11:20 -0800)]
default to WANT_SHARE_INSTALL off

9 years agoadd postinstall script to set the file permissions
Haoyang Wang [Mon, 2 Nov 2015 19:14:44 +0000 (11:14 -0800)]
add postinstall script to set the file permissions

9 years agofix make install; fix the package directory tree
Haoyang Wang [Sun, 1 Nov 2015 16:32:23 +0000 (08:32 -0800)]
fix make install; fix the package directory tree

9 years agoChange the root directory to /usr/local/games
Haoyang Wang [Mon, 26 Oct 2015 03:44:07 +0000 (20:44 -0700)]
Change the root directory to /usr/local/games

9 years agoPackageManager is no longer available. Use productbuild instead.
Haoyang Wang [Thu, 11 Jun 2015 01:14:15 +0000 (18:14 -0700)]
PackageManager is no longer available. Use productbuild instead.

9 years agotribute: A Hat Full of Sky
PatR [Mon, 9 Nov 2015 01:58:49 +0000 (17:58 -0800)]
tribute: A Hat Full of Sky

9 years agoAdd quote for cream pie
Pasi Kallinen [Sun, 8 Nov 2015 13:28:19 +0000 (15:28 +0200)]
Add quote for cream pie

9 years agolast of the reformatting...
PatR [Sun, 8 Nov 2015 09:41:43 +0000 (01:41 -0800)]
last of the reformatting...

This one has a couple of code changes included, but they shouldn't
produce any change in game play.  If anyone adds a new shirt or shield
they'll have to update the corresponding foo_on() and foo_off() routines
to avoid an 'impossible' when putting on or taking off the new item(s),
the same situation as already happens for other subclasses of armor.

9 years agomore formatting
PatR [Sun, 8 Nov 2015 09:37:55 +0000 (01:37 -0800)]
more formatting

Mostly tab replacement, plus the last of the cast spacing.

9 years agoAdd quote for blue jelly
Pasi Kallinen [Sun, 8 Nov 2015 09:13:14 +0000 (11:13 +0200)]
Add quote for blue jelly

9 years agoformatting: more casts
PatR [Sun, 8 Nov 2015 04:02:04 +0000 (20:02 -0800)]
formatting:  more casts

9 years agoAdd a quote for bullwhip
Pasi Kallinen [Sat, 7 Nov 2015 21:50:40 +0000 (23:50 +0200)]
Add a quote for bullwhip

9 years agoAdd boomerang quote
Pasi Kallinen [Sat, 7 Nov 2015 19:56:18 +0000 (21:56 +0200)]
Add boomerang quote

9 years agoformatting: more (typedef) (expression)
PatR [Sat, 7 Nov 2015 10:35:22 +0000 (02:35 -0800)]
formatting: more (typedef) (expression)

9 years agoMake status hilites show none instead of empty in options
Pasi Kallinen [Sat, 7 Nov 2015 09:55:12 +0000 (11:55 +0200)]
Make status hilites show none instead of empty in options

9 years agoformatting: casts involving typedefs
PatR [Sat, 7 Nov 2015 09:12:30 +0000 (01:12 -0800)]
formatting: casts involving typedefs

The automated reformatting put a space in casts of the form
'(type)(expression)', yielding '(type) (expression)', but it didn't
do that for '(typedef)(expression)'.  There are lots of instances of
'(boolean)(expression)'; (uchar) and (xchar) also occur.  I haven't
noticed other types, but I haven't looked in very many files yet.

9 years agoRemove stray character
Pasi Kallinen [Sat, 7 Nov 2015 08:59:43 +0000 (10:59 +0200)]
Remove stray character

9 years agorn2()/rnd() debugging
PatR [Sat, 7 Nov 2015 08:12:09 +0000 (00:12 -0800)]
rn2()/rnd() debugging

Finding bad calls to rn2(0) or rnd(0) should not be dependent upon
having DEBUGFILES=rnd.c, so switch from debugpline() to impossible().

9 years agoRephrase version number in comment
Pasi Kallinen [Sat, 7 Nov 2015 07:06:13 +0000 (09:06 +0200)]
Rephrase version number in comment

9 years agoyet more src reformatting
PatR [Sat, 7 Nov 2015 02:03:13 +0000 (18:03 -0800)]
yet more src reformatting

Last of the suspicious block comments, plus the usual miscellaneous
stuff in files that hadn't been subjected to it before.

9 years agocouple of string concatenations in win/tty/
PatR [Sat, 7 Nov 2015 00:39:29 +0000 (16:39 -0800)]
couple of string concatenations in win/tty/

Plus a modest amount (really!) of reformatting.

Also got rid of 'copy_of()' since dupstr() does the same thing [except
for the 'treat Null as ""' part; when needed, that can be done in the
call:  dupstr(!str ? "" : str)].

9 years agoeliminate implicit concatenation of strings
PatR [Fri, 6 Nov 2015 23:57:23 +0000 (15:57 -0800)]
eliminate implicit concatenation of strings

Explicitly combine adjacent string literals so that pre-ANSI compilers
still have a chance to compile the code.  I thought these had already
been dealt with, but I kept stumbling across them while reformatting,
so am trying to get them all out of the way now.

9 years agoUpdate version numbers in source comments
Pasi Kallinen [Fri, 6 Nov 2015 14:04:48 +0000 (16:04 +0200)]
Update version numbers in source comments

9 years agoFix one version number in the Guidebooks
Pasi Kallinen [Fri, 6 Nov 2015 13:56:47 +0000 (15:56 +0200)]
Fix one version number in the Guidebooks

9 years agoRemove a leftover ifdef REINCARNATION
Pasi Kallinen [Fri, 6 Nov 2015 13:49:29 +0000 (15:49 +0200)]
Remove a leftover ifdef REINCARNATION

9 years agoClean fixes file and lev_comp docs tiny bit
Pasi Kallinen [Fri, 6 Nov 2015 13:42:36 +0000 (15:42 +0200)]
Clean fixes file and lev_comp docs tiny bit

9 years agoUpdate the linux README
Pasi Kallinen [Fri, 6 Nov 2015 13:35:38 +0000 (15:35 +0200)]
Update the linux README

9 years agomore src reformatting
PatR [Fri, 6 Nov 2015 11:14:50 +0000 (03:14 -0800)]
more src reformatting

Fixing up mis-indented block comments, but hit some files that hadn't
had the earlier mixture of tab replacement, etc, so it's bigger than I
expected.  If I get to it, they'll be another round of this tomorrow.

9 years agofix scroll of charging
PatR [Fri, 6 Nov 2015 02:39:02 +0000 (18:39 -0800)]
fix scroll of charging

The intended change was that you'd get an increase to max energy if
current was sufficiently close to max rather than only when it was
already at max.  It wasn't intended that you'd fail to have current
boosted all the way to max in the case where it wasn't sufficiently
close.  That's fixed here.

9 years agoFree allocated temporary lregion
Pasi Kallinen [Thu, 5 Nov 2015 19:03:57 +0000 (21:03 +0200)]
Free allocated temporary lregion

9 years agoformatting - last of the trailing continuations
PatR [Thu, 5 Nov 2015 08:54:13 +0000 (00:54 -0800)]
formatting - last of the trailing continuations

Last few && or || followed by end-of-line comments, plus tab replacement
and 'return' parentheses.  Not as many of those; some of these files had
already had that done.

Also, tweaked non-cursed scroll of charging read while confused to be a
tiny bit more effective.

To do:  find and fix block comments that immediately follow a line with
an end-of-line comment and got misindented to line up with that comment.

9 years agoAllow some variance in corridors and reduce predictability
Pasi Kallinen [Wed, 4 Nov 2015 19:13:34 +0000 (21:13 +0200)]
Allow some variance in corridors and reduce predictability

The corridors used to head towards the goal using the straightest
possible line, often making a zig-zag beeline. Allow some slight variance,
sometimes going straight instead of turning, reducing the predictability,
and making those monotonously turning corridors less likely.

9 years agomultishot throwing/shooting feedback
PatR [Wed, 4 Nov 2015 10:57:40 +0000 (02:57 -0800)]
multishot throwing/shooting feedback

While the topic of strprepend() is current, make good use of it.
Simplify code which inserts "the Nth " in front of "<arrow,&c>".

I'm pretty sure there are one or two other places where I assumed that
the outpuf of xname() was a char array which is BUFSZ in length rather
than BUFSZ-PREFIX, and reused the buffer, but I don't know where they
occur.  (BUFSZ-PREFIX is still big enough to hold most things, so it
might not lead to trouble.)

9 years agospellcasting bug fix: confusion duration
PatR [Wed, 4 Nov 2015 10:27:59 +0000 (02:27 -0800)]
spellcasting bug fix: confusion duration

Fix the reported bug that attempting to cast an expired spell, which
causes confusion and/or stun, was replacing the duration of any existing
confusion or stun with the new amount rather than increasing it by that
amount.

Attempting to cast any spell while stunned will now fail immediately,
and casting an expired spell while confused will increase confusion
duration (and/or set stun duration) rather than override it.

9 years agoanother batch of formatting
PatR [Wed, 4 Nov 2015 02:28:53 +0000 (18:28 -0800)]
another batch of formatting

Same sort of stuff as before:  some continuation lines with operator
followed by end of line comment (only a few files with those still to
go...), plus tab replaced by spaces in comments, excess parenthesis
removal for return statements, and force function name to be in column
one in function definitions:
  type name(args) /* comment */
  argtype args;
  {
to
  /* comment */
  type
  name(args)
  argtype args;
  {
I've been spotting those by eye rather than rexexp, so probably missed
some.

9 years agopotions of gain energy
PatR [Wed, 4 Nov 2015 02:13:00 +0000 (18:13 -0800)]
potions of gain energy

When doing some more reformatting I came across something I've been
meaning to tweak for a long time, and since the change is only a couple
of lines I'm putting it in now instead of waiting.  Make potions of
gain energy more useful for actually regaining energy so they might not
be relegated to alchemy all the time.  The adjustment is probably too
low to really achieve that, but I didn't want to risk going too high.

Increase to max energy is only a little higher (average 10.5 vs 9 for
blessed, 7 vs 4 for uncursed) but to current energy is noticeably higher
(31.5 vs 9 for blessed, 21 vs 4 for uncursed; capped by max energy so
bigger increase only matters if current is below max when quaffing).

9 years agoreleasing inventory window(s)
PatR [Tue, 3 Nov 2015 02:14:57 +0000 (18:14 -0800)]
releasing inventory window(s)

This should address the issue that the problem patch to display_pickinv()
was trying to deal with:  releasing the inventory window before exiting
the program so Pasi's memory checker doesn't think it's a memory leak.

Not related, but in the same file:
The older qsort comparison routines are tagged with CFDECLSPEC to deal
with some C vs C++ interaction issue.  I added that to the relatively
recently added 'sortloot' qsort compare callback.

I also changed worn_wield_only(), although it isn't actually called.
(display_minventory() has provisions to call it, but both of the latter's
callers pass in MINV_ALL so allow_all() gets used instead.)

9 years agoRevert the created inventory nhwindow destruction
Pasi Kallinen [Mon, 2 Nov 2015 20:23:08 +0000 (22:23 +0200)]
Revert the created inventory nhwindow destruction

At least perm_invent (and other stuff?) causes problems with this.

9 years agofix can_carry()
PatR [Mon, 2 Nov 2015 09:53:38 +0000 (01:53 -0800)]
fix can_carry()

Noticed while going through more reformatting:  can_carry() was changed
to return a number rather than yes/no, but it's trying to return a long
value (obj->quan) as an int.

Gold is the only thing likely to exceed LARGEST_INT in actual play
(although rocks could manage it if somebody tried hard enough).  This
makes sure that the value returned doesn't exceed LARGEST_INT, but only
tame monsters honor the resulting subset value (at least for gold) and
split the stack.  The proper fix is to convert can_carry() and all its
uses to long, but I'd rather spend my time on other stuff.

9 years agoforce NHSUBST for X11 icons
PatR [Mon, 2 Nov 2015 09:51:58 +0000 (01:51 -0800)]
force NHSUBST for X11 icons