Commit Graph

10428 Commits

Author SHA1 Message Date
nhmall
a72635005d Merge branch 'NetHack-3.6.2' 2019-02-10 18:22:02 -05:00
nhmall
d711f1a167 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-10 18:21:43 -05:00
PatR
da1212077d isaac64 on vms
Not tested yet...
2019-02-10 13:54:16 -08:00
PatR
f067a3e9ff compiling isaac64.c
Revise isaac64.c so that it can be compiled unconditionally and
yield nothing if USE_ISAAC64 isn't defined.  Necessary for building
via vmsbuild.com.
2019-02-10 13:41:45 -08:00
nhmall
7d703fa978 Merge branch 'NetHack-3.6.2' 2019-02-10 00:08:07 -05:00
nhmall
7f5ce35dae Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-10 00:05:44 -05:00
PatR
16dc5870cb comment typo 2019-02-09 16:27:51 -08:00
PatR
128d1628a9 fix #H8124 - interrupted donning gives player info
about the armor.  Wearing armor sets obj->known, making its enchantment
be shown when it gets formatted, because the AC value on the status line
lets the player deduce what that is.  It was being set at the beginning
of the wear operation.  If the armor got stolen before it became fully
worn, the enchantment was still shown.  Defer that until the end of the
operation.  An attentive player can still deduce the enchantment if the
item is stolen (because its protection starts immediately) but the hero
won't learn that enchantment unless the donning completes.

This might be suboptimal but it isn't qualitatively different from
watching a pet walk/not-walk over items whose bless/curse state isn't
known or dropping unidentified items in a shop to check their price.
The player can deduce something that the hero doesn't know yet.
2019-02-09 16:07:18 -08:00
PatR
2d62513b1b minor nitpicks
A couple of trivial things I noticed while looking at status cleanup.
2019-02-09 15:33:16 -08:00
PatR
d80fd8a014 curses status cleanup
Stop the last of the memory leaks occuring during basic usage.
2019-02-09 15:30:53 -08:00
nhmall
0d63372a48 Merge branch 'NetHack-3.6.2' 2019-02-08 19:58:58 -05:00
nhmall
8da50471fe Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-08 19:58:36 -05:00
nhmall
a3527e7eab fix some merge fallout from 3.6.2 curses changes 2019-02-08 19:54:09 -05:00
PatR
d4d7901eff more curses memory
Message history now cleaned up at game end.  Status window cleanup is
not taking place because the core is suppressing it #if STATUS_HILITES.
2019-02-08 16:51:33 -08:00
nhmall
988a6e8c6b Merge branch 'NetHack-3.6.2' 2019-02-08 19:03:39 -05:00
nhmall
50325f705f Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-08 19:03:20 -05:00
nhmall
abf87e30ca Merge branch 'NetHack-3.6.2' 2019-02-08 19:02:06 -05:00
nhmall
b8edefca50 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-08 18:52:22 -05:00
PatR
f3072cdb43 curses: plug most memory leaks
This takes care of a lot of the leaked memory in the curses interface.
It still needs to free memory allocated for status fields when the
status window is destroyed at game end; likewise for message history
when the message window is destroyed.
2019-02-08 15:50:59 -08:00
PatR
e991dd1b0c curses: getline vs DEL, ESC
Support <delete> (aka <rubout>) during getline().  It doesn't actually
honor the current erase_char value set up for the terminal, just
treats DEL the same as ^H.  (The previous lack of support had nothing
to do with terminfo specifying ^H; the handling is hard-coded.)

tty treats escape while there's already some input as kill_char (erase
the input but get more from scratch) and returns ESC if there isn't.
curses was doing the first half but not the second, so not providing
any way to communicate "cancel" back to the core.  Fix is simple.

Other getline() bug fixes:
1] there was a wprintw("%*something") which was passing the value from
strlen (type 'size_t') to the "%*" argument (type 'int').  That's
always wrong (size_t is guaranteed to be unsigned) and could be severe
(if size_t is different width than int--as on current OSX systems--
depending upon the internals of argument passing).
2] strncpy() only supplies a terminating '\0' if the input is shorter
than the number of characters specified.

A lot of reformatting is warranted but I only did the getline routine
(manually, so might have missed stuff).
2019-02-08 14:54:40 -08:00
nhmall
88683be479 Merge branch 'NetHack-3.6.2' 2019-02-08 14:53:22 -05:00
nhmall
c2db9405f8 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-08 14:52:57 -05:00
PatR
1d5b59ab7e curses memory: 'anything identifier'
Three or four instances of one simple memory leak.  Allocating a union
'anything' to pass to add_menu(), then not doing anything with it.  The
value gets copied so there's no reason for the original to stick around.

[There are still lots of other memory leaks.]
2019-02-07 17:10:55 -08:00
nhmall
c2d3fb816a Merge branch 'NetHack-3.6.2' 2019-02-07 20:06:22 -05:00
nhmall
8a8f39d2b5 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-07 20:05:02 -05:00
PatR
19d737951e curses: change from malloc() to nethack's alloc()
There was no provision for malloc() potentially returning Null and it
wasn't integrated with nethack's MONITOR_HEAP.  'heaputil' shows that
the curses interface is leaking like a sieve.  If some things are
actually being allocated separately and then freed from within curses,
those need to be thoroughly documented and maybe switched back to
malloc().
2019-02-07 16:48:37 -08:00
PatR
b1de94f922 custompline(SUPPRESS_HISTORY,...) for curses
The curses interface already has a hack to keep 'Count: 12', 'Count:
123' intermediate multi-digit counts out of its message recall history
for ^P, but it was flushing real messages when getpos()'s 'autodescribe'
reported what the cursor moved over.  Overload the count hack to support
 putstr(WIN_MESSAGE, ATR_NOHISTORY, text)
(which is what custompline(SUPPRESS_HISTORY, ...) eventually calls).

The conditional logic for when to create the 'count_window' was pretty
convoluted.  This simplification has the same semantics but I don't
have PDCURSES to actually verify that.
2019-02-07 16:04:24 -08:00
nhmall
6cf233f6b5 Merge branch 'NetHack-3.6.2' 2019-02-05 21:53:43 -05:00
nhmall
cdb9b9ebd7 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-05 21:53:19 -05:00
PatR
8c1e499f8b armor comments
I don't see the #H8124 bug getting fixed any time soon, so add a
comment about it since the relevant place is unambiguous.

No change in code except removing a couple instances of 'register'.
2019-02-05 14:49:43 -08:00
PatR
423cf77a37 more message history
Noticed while investigating the issue with DECgraphics characters in
msg_window:full/combination/reverse output for tty which got fixed
by the previous commit.  There was a discrepancy in DUMPLOG because
the pager code bypasses pline() in order to use putmixed().  tty
puts strings from the latter into ^P recall history (although they'll
only render correctly if nothing after the first character needs
special handling), but nothing was putting that same info into
DUMPLOG.  This fix is pretty clumsy but eliminates the discrepancy.
2019-02-04 18:40:55 -08:00
nhmall
72226b4189 Merge branch 'NetHack-3.6.2' 2019-02-04 21:40:16 -05:00
nhmall
416deebb55 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-04 21:39:53 -05:00
PatR
a8a187f89b tty ^P recall for dolook/whatis feedback
Noticed while testing the history suppression:  if you have DECgraphics
enabled and look at a graphics character on the map, the topline shows
x      description of x
where 'x' is displayed as it appears on the map (line drawing char).
^P for msg_window:single knows about that and reproduces the effect if
you recall such a line.  But msg_window:full/combination/reverse didn't
know about that and dumped it as-is into text output, ending up with a
strange 8-bit character for 'x' instead of the line drawing one.

I think other rendering schemes will be unaffected by this.  It's just
duplicating what is done for msg_window:single.
2019-02-04 18:24:17 -08:00
nhmall
f3ec2be446 Merge branch 'NetHack-3.6.2' 2019-02-04 20:54:25 -05:00
nhmall
481a397c14 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-04 20:54:05 -05:00
nhmall
d2ed79e1d1 merge conflict fix part 3 2019-02-04 20:52:21 -05:00
nhmall
2b6b4c0833 fixes entry for amiga fix
Also, a pull request 175 showed up after the earlier commit for the missing
continuation lines, so mark the pull request as closed.

closes #175
2019-02-04 20:27:18 -05:00
nhmall
339072e8df merge conflict fix 2019-02-04 20:14:50 -05:00
nhmall
44e13885be Merge branch 'NetHack-3.6.2' 2019-02-04 20:08:30 -05:00
nhmall
a2a4f66318 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-04 20:05:28 -05:00
nhmall
ba030ade7b Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2019-02-04 20:04:59 -05:00
nhmall
7042e5fdef another contributed Amiga bit, missing line continuations in Makefile 2019-02-04 20:02:53 -05:00
PatR
18cea92a59 tty ^P fixes entry
Left this out of previous commit.
2019-02-04 16:52:37 -08:00
PatR
190c90e95e tty ^P message recall
Extend 'putstr(WIN_MESSAGE, attribute, string)'s attribute so that
'custompline(SUPPRESS_HISTORY, ...)' can work with ^P's message
history like DUMPLOG history, in order to keep autodescribe feedback
and intermediate prompts for multi-digit count ('Count: 12', 'Count:
123') prompts out of recall history.  The old autodescribe behavior
could easily push all real messages out of the recall buffer when
moving the cursor around for getpos, and the count behavior looked
silly for a four or five digit gold count if you set the msg_window
option to 'full' or 'combination' and viewed them all at once.

Other interfaces may want to follow suit, but this doesn't force them
to make any changes.  I added a hook for "urgent messages" that might
be rendered in bold or red or some such and/or override the use of
ESC at --More-- from suppressing further messages, but there aren't
any custompline(URGENT_MESSAGE, ...) calls (potentially "You die...",
for instance) to exercise it.  Other people have implemented similar
feature it different ways and I'm not sure whether this one is really
the way to go since the core needs to categorize each message that it
deems to be urgent.  MSG_TYPE:stop may be sufficent, although MSG_TYPE
matching can entail a lot of regexp execution overhead at run-time.
2019-02-04 16:46:04 -08:00
nhmall
8eebfd7cf3 merge NetHack-3.6.2 part 2 2019-02-04 18:39:07 -05:00
nhmall
560ffd711a Merge branch 'NetHack-3.6.2' 2019-02-04 18:37:38 -05:00
nhmall
f1c91dbd75 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-04 18:37:15 -05:00
nhmall
f38dca7cb1 variable moved to context long ago
just reported, a variable moved to context long ago
2019-02-04 18:35:17 -05:00
PatR
3896fcff8b function call through pointer
There be others of these.  Don't for ANSI C for something this simple.
2019-02-04 15:01:36 -08:00