Commit Graph

7946 Commits

Author SHA1 Message Date
PatR
e0bf7a01cc nethack.sh: test -e vs test -f
Change the test for whether fonts.dir exists (added to the script
in 3.6.0, for automatically setting up possible use of the NH10 font
under X11) from 'test -e file' to 'test -f file' since the latter
seems to be more universally available.  When present, fonts.dir is
plain text, so a test for "exists and is a regular file" rather than
one for general existance is appropriate.
2019-03-12 14:11:26 -07:00
PatR
8e7fe38dae avoid crash for X11 tombstone
If nethack is built to use graphical tombstone but file rip.xpm is
missing from the playground, there would be a crash if the rip output
was shown.  My first attempt to fix it prevented the crash but didn't
display any tombstone, just the last couple of lines of output which
follow the tombstone.  This keeps that in case of some other Xpm
failure, but checks for rip.xpm via stdio and reverts to genl_outrip
for text tombstone if it can't be opened.
2019-03-12 13:31:00 -07:00
PatR
44639ab1e8 long #version feedback
Hide a bug in the X11 interface by manually wrapping 'short' version
line (the first line of #version output) when runtime ID or git hash
and/or branch is present.  Otherwise the very wide 'short' line causes
a horizontal scrollbar to be present at the bottom of the popup window,
but the window size doesn't take that into account so ends up being
one line too short.  Worse, there's no vertical scrollbar to bring the
last line into view.

Even if somebody figures out how to fix that properly, the really wide
line above a couple of paragraphs which have been carefully wrapped
for a much narrower width looked strange.

Also, move the 'short' version's period to the end of the text.
old: basic version info. (extra info)
new: basic version info (extra info).
2019-03-11 18:11:21 -07:00
PatR
53777fa03a win/curses comment
Twice I've gone through the curses code to deal with CHAR_P, BOOLEAN_P,
and so forth.  Both times I eventually changed my mind.  This time I'm
just adding an explanatory comment instead.
2019-03-10 16:06:29 -07:00
PatR
683226c3c5 curses vs extended commands
Extend the earlier support for Delete/Rubout in getline() to the
text entry for extended commands.  In other words, treat <delete>
and <backspace> as synonyms in both places.

Some reformatting too, but only in a couple of the files.
2019-03-10 14:53:31 -07:00
PatR
02b21865fd more UCHAR_P
When setting up an alternate definition for UCHAR_P to accommodate
DEC C's non-ANSI mode(s), leave the default definition to tradstdc.h.
DEC C's VAXC mode will end up expecting 'unsigned char' rather than
either 'int' or 'unsigned int'.  Not applicable for Unix but this
makes similar change there as is being made for VMS.
2019-03-08 11:48:31 -08:00
PatR
df84da3ec2 vms update
Suppress Isaac64 on VAX were there isn't an easy way to do 64-bit
arithmetic.  (Hard way isn't worth it for just an alternate RNG.)

Eliminate or suppress some diagnostics:

1) In strict ANSI mode, DEC C was reporting that '$' in identifier is
an extension (one time for each file in sys/vms/*.c).  (It doesn't do
that for the default 'relaxed ANSI' mode.)

2) DEC C uses WIDENED_PROTOTYPES but widens uchar (unsigned char)
differently depending upon the mode it is operating in.  (Applies to
Unix as well as VMS; based on documentation rather than testing.)

Update the comment in tradstdc.h about WIDENED vs UNWIDENED_PROTOTYPES.

An old comment in config1.h about a problem with the earliest version
of DEC C was probably based on an incorrect assumption of what was
really going, but I have no way to go back in time to verify that....
2019-03-07 17:12:01 -08:00
PatR
8728de2a0a fix #H8330 - kicking obj stack uses wrong weight
Kicking a stack splits off one item (except for gold coins) and
propels it, but the range for how far it would move was calculated
before the split using the entire stack's weight.  So a large stack of
small items might fail with "thump" (which the report suggested hurt
the hero, but it doesn't) and none of the stack would move.  Splitting
sooner looked complicated because of several potential early returns
between the range calculation and the eventual kick, so this hacks the
stack's quantity to get the intended weight instead.
2019-03-06 16:59:39 -08:00
PatR
62507fa40f sys/share/*_yacc.c update
For the pre-generated yacc sources, revert to the version of byacc
used for 3.6.1 and 3.6.0 to avoid unnecessary changes for 3.6.2.
2019-03-06 11:43:27 -08:00
PatR
df3df3cb6f revise integer.h for vms
The VMS compiler supports C99 and defines __STDC_VERSION__ to the
corresponding value, but it doesn't supply <stdint.h> so isaac64.c
wouldn't compile.  It does supply another header containing what is
needed.
2019-03-06 11:37:52 -08:00
PatR
e2b6cf4066 fix #H8319 - hero-owned container used inside shop
showed non-empty containers in inventory (including the one being
applied) with a 'for sale' suffix during put-in operations, as if the
shop was trying to sell it to the hero.  Amount shown was cumulative
value of its contents.  (Using /menustyle:T doesn't show the container
being applied so this wasn't visible with it unless other non-empty
containers were being carried.)

Two or three fix attempts solved one problem but introduced another.
This one seems to finally get things right but considering that there
was trial and error along the way, my confidence isn't great.
2019-03-04 14:40:01 -08:00
PatR
b211c1b832 fix #H8310 - riding a saddled tripe ration
If steed ate a mimic corpse and started mimicking an object or dungeon
furniture, the hero was able to keep riding.  Force a dismount when
that happens, even if steed takes on monster shape rather than object
or furniture.  After that, #ride to remount non-monster will fail
unless using wizard mode's "force mount to succeed" action, in which
case steed's eating finishes immediately and it returns to normal.

This doesn't address the older report that mounted hero can continue
to move around while the steed is eating.
2019-03-01 18:32:41 -08:00
PatR
23ea5b07fe Guidebook update
number_pad got removed from Guidebook.tex when mouse_support was added
by cc0e7a8750fd4e07d3a44592c38f5912d4e603de; put it back.  Evidently
a cut-and-paste mishap when copy-and-paste was intended, probably
provoked by '\numbox{}'.

Remove \numbox{} from mouse_support; it isn't needed there since the
choices aren't trying to line up with '-1'.

Both Guidebook.mn and Guidebook.tex:

Remove number_pad's "for backward compatibility" from mouse_support
since the latter is brand new.

New petattr list of uppercase letters seemed intrusive when rendered
with a bold font, so switch to lowercase.  (Option processing already
supports either case.)

Mention the '=' prefix for hilite_status 'absolute' threshold.

[As usual, the Guidebook.tex changes haven't been tested.]
2019-03-01 17:09:54 -08:00
PatR
7664d604da fix #H8297 - healer vs undead turning
Report forwarded from spam filter so not included in bugzilla list.
Make corpse revival feedback be more consistent.  Some of the healer-
specific flavor is still there.
2019-02-28 15:12:12 -08:00
PatR
eb1514da15 document curses options
Add curses options to the Guidebook.

The TeX one hasn't been tested (particularly "term_cols and\nterm_rows")
and windowborders #3).
2019-02-27 16:04:51 -08:00
nhmall
6a81d78c56 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2019-02-26 19:53:42 -05:00
nhmall
be3092bed4 some fish should lay their eggs in the water rather than on land
Generally, fish should lay their eggs in the water and
not on land, but the game was only allowing the opposite.

Eels are catadromous and lay their eggs in the Sargasso Sea,
not in the dungeon.
2019-02-26 19:49:24 -05:00
PatR
1a028d1197 curses run-time options
This started out as an attempt to document the curses options in the
Guidebook, but I didn't actually get that far.  Instead, integrate
the curses options better via more consistent WC/WC2 usage.  This
prevents 'guicolor' from showing up as a boolean option for non-curses
interface in curses+other binary.

For curses itself, let 'petattr' be set/reset via 'O'.  Also, accept
'Dim' as a possible pet highlight attribute since it already handles
all the other ordinary attributes.  I'm not sure what leftline and
rightline highlighting are supposed to do.  They were missing for
ncurses (or maybe they're misspelled for PDcurses?) but adding them
didn't produce any visible effect (using TERM=xterm-256color on OSX
with default font/character set).

Not addressed:
1) general confusion about compile-time vs run-time option filtering;
2) curses pet highlighting only works if 'color' option is enabled.
2019-02-26 15:16:42 -08:00
PatR
5a432d0c97 toggling persistent inventory window
Something else noticed while testing #H8271:  toggling perm_invent on
with 'O' didn't show anything (at least with curses) until some later
action caused it to be updated.  Make updating persistent inventory be
included with full redraw and set the need_redraw flag when toggling
perm_invent.
2019-02-25 15:48:29 -08:00
PatR
4df491e47d more wearing armor vs perm_invent window
Realized while fixing #H8271:  if persistent inventory got an update
while wearing or taking off was in progress (not within user's control
since hero is busy) the item in question was flagged as "(being worn)"
even though it wouldn't be worn if putting on got interrupted.  Update
doname() to show "(being donned)" or "(being doffed)" instead of
"(being worn)" when corresponding operation is in progress. (During
testing, I was able to observe "being doffed" but never managed to see
"being donned".)
2019-02-25 15:44:21 -08:00
PatR
2b2106743e fix #H8271 - wearing armor vs perm_invent window
A relatively recent change moved 'obj->known = 1' when wearing armor
from before setworn(), which issues an update_inventory() call, to
afterwards.  There wasn't any particular update then, so observing
the enchantment of armor by wearing it wasn't being reflected in the
persistent inventory window if that was enabled.
2019-02-25 15:33:43 -08:00
nhmall
587a51bee7 include isaac64 in xcode build 2019-02-24 14:35:49 -05:00
keni
1825f51c4f Minor Guidebook.{tex,mn} wording and typos. UR macro. 2019-02-22 20:00:14 -05:00
PatR
98002b3166 vms/Makefile.src - curses
Add curses dependencies to VMS Makefile.  Not tested.
2019-02-22 14:56:42 -08:00
PatR
17a00b5032 unix/Makefile.src - wincurs.h
I don't know whether anyone uses 'make tags' any more, but it was
missing include/wincurs.h (and win/curses/*.h, but I'm ingoring those).
2019-02-22 14:55:29 -08:00
PatR
e0db41572a more bz 1604 - re-do vs autoquiver
Take another crack at describing yesterday's do-again fix.  Having
'autoquiver' enabled wasn't necessary to encounter the problem.
Also, 'in_doagain' is an int rather than a boolean.
2019-02-22 12:54:39 -08:00
nhmall
fb14c283c3 fix typo in comment 2019-02-22 09:00:53 -05:00
nhw_cron
c162850c7d This is cron-daily v1-Feb-22-2019. guidebook updated: doc/Guidebook.txt 2019-02-22 08:26:44 -05:00
nhw_cron
1fde15c609 This is cron-daily v1-Feb-22-2019. files updated: Files 2019-02-22 08:26:21 -05:00
PatR
2579a3dcbb fix #H8237 - corpse on an invalid trap
It's possible to get a rolling boulder trap which doesn't have any
boulder.  That isn't invalid, but if/when it happens on a shallow
level it shouldn't be covered by the corpse of a fake adventurer
since such a trap won't kill anyone.
2019-02-21 17:53:19 -08:00
keni
738dce6b00 set up for proper generation of Files file 2019-02-21 20:32:36 -05:00
PatR
9c4a6afe46 fix bz 1604 - re-do vs autoquiver
One-line fix is much shorter than attempting to describe the problem.
^A could misuse previous input if 'f'<direction> needed to fill the
quiver and there was nothing suitable, so that the sequence became
'f'<what to throw>.  If previous <direction> was an inventory letter
that was occupied, and the item it that slot wasn't already worn in
some other slot, it would be put in quiver slot.  Then player would
be asked for direction rather than immediately throwing it since the
what-to-throw prompt had just used up the last of the ^A queue.

Miscellaneous formatting included....
2019-02-21 13:28:18 -08:00
PatR
8b08378bf7 DECgraphics vs eight_bit_tty
The fuzzer likes to set options randomly; the combination of
DECgraphics symbol set (on a display capable of rendering it) plus
eight_bit_tty produces a bizarre map display.  Make DECgraphics
override eight_bit_tty rather than the other way around.
2019-02-19 18:25:02 -08:00
PatR
01c400a200 OSX has /dev/random
We aren't defining BSD for OSX but we probably should be.  This doesn't
go that far, just changes a couple of __APPLE__ for MACOSX (set up in
config1.h) and defines DEV_RANDOM as "/dev/random".
2019-02-18 15:34:09 -08:00
PatR
b516b5fd9e more #H8215 - monster instrinsics 2019-02-18 15:24:02 -08:00
PatR
48ea357266 poly'd hero movement
Noticed while fixing the 'monster intrinsics from worn gear' bug(s):
set_uasmon() calls set_mon_data(&youmonst,...) which updates movement
when the monster polymorphs into something slower, then it did the
same thing to youmonst.movement itself, hitting the hero with a double
dose of reduction for any movement points not yet spent on current
turn.  Remove the set_uasmon() side of that, and change set_mon_data()
side to add a redundant non-zero test to prevent static analysis from
warning that it might be dividing by 0.
2019-02-18 13:24:58 -08:00
PatR
a6ff7210be fix #H8215 - monster intrinsics from worn gear
Fixes #177

The monst struct has 'mintrinsics' field which attempts to handle
both mon->data->mresists and extrinsics supplied by worn armor, but
polymorph/shape-change was clobbering the extrinsics side of things.
Potentially fixing that by changing newcham() to use set_mon_data(...,1)
instead of (...,0) solved that but exposed two other bugs.  Intrinsics
from the old form carried over to the new form along with extrinsics
from worn armor, and update_mon_intrinsics() for armor being destroyed
or dropped only worked as intended if the armor->owornmask was cleared
beforehand--some places were clearing it after, so extrinsics from worn
gear could persist even after that gear was gone.

So, fixing the set_mon_data() call in newcham() was a no go.  This
fixes update_mon_intrinsics() and adopts the suggested code from
github pull request #177 to have mon->mintrinsics only handle worn
gear instead of trying to overload innate intrinsics with that.  This
is a superset of that; the flag argument to set_mon_data() is gone
and mon->mintrinsics has been renamed mon->mextrinsics.  (The routine
update_mon_intrinsics() ought to be renamed too, but I didn't do that.)
2019-02-18 13:17:14 -08:00
PatR
6b54456c45 extended #version windowing options
When makedefs generates dat/options for #version, enhance the
formatting of the 'supported windowing systems' section with more
thorough word fill and also emphasize the actual window system names
so that user can tell what value to give to OPTIONS=window_system:%s
when picking one of them.  Before and after

Supported windowing systems:
    traditional tty-based graphics,
    terminal-based graphics using curses libraries, and X11
    with a default of tty.

Supported windowing systems:
    "tty" (traditional text with optional line-drawing), "curses"
    (terminal-based graphics), and "X11", with a default of "tty".
2019-02-17 15:00:43 -08:00
PatR
4a9a92a2e8 VMS curses
Add untested support for building the curses interface instead of or
in addtion to tty.

While in there, update Makefile.src's isaac64.obj dependency.
2019-02-16 15:34:23 -08:00
nhmall
d5d4aed4e1 NetHack Windows curses port build with Jan 2019 PDCurses update
Clear up some NetHack warnings with updated PDCurses by using
-DCHTYPE_32

..\win\curses\cursinvt.c(98): warning C4244: 'function': conversion from 'attr_t' to 'int', possible loss of data
..\win\curses\cursinvt.c(101): warning C4244: 'function': conversion from 'attr_t' to 'int', possible loss of data
..\win\curses\cursinvt.c(105): warning C4244: 'function': conversion from 'attr_t' to 'int', possible loss of data
2019-02-16 14:15:35 -05:00
PatR
fc2f2c51a4 VMS system.h bit
Avoid some duplicate declarations for VMS.  The one for lseek()
has become an issue--not fixed here--and this narrows it down to
one place.
2019-02-15 14:10:09 -08:00
PatR
109a9707ae array lint
Suppress a diagnostic from the VMS compiler that the '&' in '&array'
has no effect.
2019-02-13 16:11:23 -08:00
PatR
a41d63d146 fix #H8183 - leather jacket doesn't show AC
Leather jacket doesn't take multiple turns to wear, so wearing it
wasn't calling Armor_on() and recently moved 'uarm->known = 1' didn't
get executed.  Not reported yet but had the same issue:  fedora and
dented pot wouldn't call Helmet_on().
2019-02-12 15:40:05 -08:00
PatR
1a8a774719 Guidebook tweak - options parsing 2019-02-11 16:30:46 -08:00
PatR
4bb5560961 more #H8167 - late messages
Do late message suppression in a different fashion.  Also, there are
more messages than shk taking hero's possessions and guard taking
hero's gold that need to be suppressed if regular message delivery
is no longer possible:  "do not pass Go", "you arise from the grave
as a foo", "the corridor disappears", "you are encased in the rock".
Those last two are from vault handling but take place in a convoluted
manner:  paygd -> mongone -> grddead -> clear_fcorr.
2019-02-11 13:39:34 -08:00
nhmall
684fee0f64 typo 2019-02-11 14:35:25 -05:00
nhmall
4150d0b443 use the NetHack macro NHSTDC in makedefs 2019-02-11 12:28:57 -05:00
nhmall
fb5e6a7bb3 arrange platform/interface fixes alphabetically by platform in fixes36.2 2019-02-11 12:23:00 -05:00
PatR
f3e7f49714 fix #H8167 - shopkeeper message after ending game
Closing nethack's window sets 'program_state.stopprint' to inhibit
disclosure interaction, but shopkeeper claiming hero's stuff or vault
guard claiming hero's gold didn't honor that and just issued normal
pline messages.  For win32, they got delivered in a popup even though
nethack's window had gone away.

Make those two end-of-game situations honor 'program_state.stopprint'.
[Fix not tested on win32...]
2019-02-10 17:45:26 -08:00
nhmall
6675055920 Guidebook date update 2019-02-10 19:02:06 -05:00