PatR [Sat, 23 Nov 2019 17:28:08 +0000 (09:28 -0800)]
more #H9375 - Rider bargethrough
I think the previous expression would allow moving (via swapping
places) from a pool to solid rock or closed door which was not what
was intended (but moot since there aren't any pools on the Astral
level). This revised expression does what is intended: can only
swap to a pool location if already located in/over (the Riders fly?
they should probably be non-breathing) another pool.
nhmall [Sat, 23 Nov 2019 03:35:48 +0000 (22:35 -0500)]
incremental improvements to cross-compiling support in NetHack 3.7
Some support of new code #defines to faciliate cross-compiling:
OPTIONS_AT_RUNTIME If this is defined, code to support obtaining
the compile time options and features is
included. If you define this, you'll also have
to compile sys/mdlib.c and link the resulting
object file into your game binary/executable.
CROSSCOMPILE Flags that this is a cross-compiled NetHack build,
where there are two stages:
1. makedefs and some other utilities are compiled
on the host platform and executed there to generate
some output files and header files needed by the
game.
2. the NetHack game files are compiled by a
cross-compiler to generate binary/executables for
a different platform than the one the build is
being run on. The executables produced for the
target platform may not be able to execute on the
build platform, except perhaps via a software
emulator.
The 2-stage process (1. host, 2.target) can be done
on the same platform to test the cross-compile
process. In that case, the host and target platforms
would be the same.
CROSSCOMPILE_HOST Separates/identifies code paths that should only be
be included in the compile on the host side, for
utilities that will be run on the host as part of
stage 1 to produce output files needed to build the
game. Examples are the code for makedefs, tile
conversion utilities, uudecode, dlb, etc.
CROSSCOMPILE_TARGET Separates/identifies code paths that should be
included on the build for the target platform
during stage 2, the cross-compiler stage. That
includes most of the pieces of the game itself
but the code is only flagged as such if it must
not execute on the host.
If you don't define any of those, things should build as before.
One follow-on change that is likely required is setting the new dependency
makedefs has on src/mdlib.c in Makefiles etc.
More information about the changes:
makedefs
- splinter off some of makedefs functionality into a separate file
called src/mdlib.c.
- src/mdlib.c, while included during the compile of makedefs.c
for producing the makedefs utility, can also be compiled
as a stand-alone object file for inclusion in the link step
of your NetHack game build. The src/mdlib.c code can then
deliver the same functionality that it provided to makedefs
right to your NetHack game code at run-time.
For example, do_runtime_info() will provide the caller with
the features and options that were built into the game.
Previously, that information was produced at build time on the
host and stored in a dat file. Under a cross-compile situation,
those values are highly suspect and might not even reflect the
correct options and setting for the cross-compiled target
platform's binary/executable. The compile of those values and
the functionality to obtain them needs to move to the target
cross-compiler stage of the build (stage 2).
- date information on the target-side binary is produced from
the cross-compiler preprocessor pre-defined macros __DATE__
and __TIME__, as they reflect the actual compile time of the
cross-compiled target and not host-side execution of a utility
to produce them. The cross-compiler itself, through those
pre-defined preprocessor macros, provides them to the target
platform binary/executable. They reflect the actual build
time of the target binary/executable (not values produced
at the time the makefiles utility was built and the
appropriate option selected to store them in a text file.)
- most Makefiles should not require adding the new file
src/mdlib.c because util/makedefs.c has a preprocessor
include "../src/mdlib.c" to draw in its contents. As previously
stated though, the Makefile dependency may be required:
makedefs.o: ../util/makedefs.c ../src/mdlib.c
^^^^^^^^^^^^^^^
PatR [Sat, 23 Nov 2019 02:16:59 +0000 (18:16 -0800)]
fix #H9375 - unintended Rider corpse suppression
Don't let Riders swap places with something (fog or ooze, perhaps)
located at a closed door spot because if it gets killed there, there
won't be any corpse and it will stop auto-reviving.
Just avoid moving to spots where mondied() won't place a corpse
instead of worrying about whether a bargethrough creature (if there
ever are any besides the Riders) might be able to survive at the
destination (so ignore pass-walls, door-opening, swimming, &c).
PatR [Fri, 22 Nov 2019 10:46:28 +0000 (02:46 -0800)]
docall fix
Noticed while testing something: hero drank a potion of see invisible
and nearby invisible monster could now be seen--in theory--but I was
asked what to call the potion while the updated map was buffered. So
I didn't see the invisible monster until after naming the potion.
pline() flushes buffered map updates, but getlin() doesn't. I didn't
change that, but I've made docall() do so since the updated map may
make a difference in what the player can tell about whatever is being
'called'.
PatR [Fri, 22 Nov 2019 01:43:55 +0000 (17:43 -0800)]
fix part of #H9397 - hallucinatory mon names
Fix the issue where a hallucinatory monster name which begins with
a slash is having that stripped off as if it was a gendor and/or
personal-name flag.
The main issue was pronouns ignoring hallucination and this doesn't
attempt to address that.
Also, add new hallucinatory name "leathery-winged avian" which has
been lurking for a while.
PatR [Mon, 18 Nov 2019 22:28:25 +0000 (14:28 -0800)]
yet more --showpaths (dumplog)
Provide a little more information when dumplog is unavailable.
While testing various permutations, I encountered a couple of
problems with conditionally declared variables.
PatR [Mon, 18 Nov 2019 00:45:10 +0000 (16:45 -0800)]
'--showpaths' dlb vs non-dlbb
Have the --showpaths feedback mention whether dlb is in use or not,
and show the container file name(s) when it is. Users of prebuilt
binaries or who build with a hints file instead of picking and
choosing things in config.h might not know, and vms (if it ever
catches up with --showpaths) uses a different container name from
everybody else ("nh-data.dlb" instead of "nhdat").
nhmall [Mon, 18 Nov 2019 00:13:23 +0000 (19:13 -0500)]
add some guard code to the Is_*_level macros in dungeon.h
All Is_*_level tests during early startup would test as true until
dungeon_topology was initialized in a new game or restored from
a save file. That could result in some unexpected code paths being
taken.
PatR [Sun, 17 Nov 2019 17:25:26 +0000 (09:25 -0800)]
pager warning fix and formatting
The mapglyph() change made a variable obsolete but it got left in
(idx = SYM_PET_OVERRIDE...). Take it out and fix up the formatting
for the block of code that had it.
PatR [Sun, 17 Nov 2019 02:31:30 +0000 (18:31 -0800)]
gas cloud fix
remove_region() calls newsym() when removing gas clouds, but when
newsym() checked whether it was updating a gas cloud location it
always got a false 'yes' because the region hadn't been removed yet.
Fixing this didn't seem to make any observable difference so it must
be followed fairly rapidly by a full vision recalc.
PatR [Sat, 16 Nov 2019 20:05:05 +0000 (12:05 -0800)]
partial fix for #H9430 - gas clouds vs monsters
Don't show the gas cloud glyph at locations where monsters can be
sensed (telepathy, warning, extended detection). It will work
better when/if vision of gas cloud locations gets fixed. (Such
clouds behave as the hero can see into them, so warning doesn't
have any unseen monsters to show unless they're unseen for some
reason other than the gas cloud.)
PatR [Sat, 16 Nov 2019 19:46:50 +0000 (11:46 -0800)]
monsters entering regions
Region processing does a lot of looping--when there are actually
regions present--and calls functions in those loops which do more
looping of their own. This moves some of the simpler tests so that
they get done sooner and can avoid some of those function calls.
I was hoping that it would speed up the turn cycle on the Plane of
Fire where the spontaneous irregularly shaped fumaroles are composed
of a lot of small regions but I don't think there's any noticeable
difference.
In process of doing that, I discovered a bug (no doubt copy+paste
which escaped an intended update) with monster handling. The check
for whether a monster is entering a region depends upon whether the
hero is in that same region rather than whether the monster is
already inside. So a monster can enter a region--or have a moving
one enclose it--with impunity if the hero is already in that region.
Once the hero moves out of it, the monster will finally enter it.
PatR [Sat, 16 Nov 2019 18:03:57 +0000 (10:03 -0800)]
curses lint
'orient' is the name of an enum defined in wincurs.h so don't use it
as a variable name in cursstat.c. My compiler didn't complain using
'-Wshadow' but apparently some other one does.
Make the same change in the dead code located in the second half of
that file, plus a couple of formatting tweaks.
PatR [Sat, 16 Nov 2019 03:03:11 +0000 (19:03 -0800)]
fix curses compile warning
From hardfought; latest gcc complains that /* fall through other stuff */
doesn't match its pattern for /* fall through */ comment indicating
that omitted 'break' statement is intentional and one switch case is
deliberately continuing into the code for another.
PatR [Sat, 16 Nov 2019 01:51:20 +0000 (17:51 -0800)]
have --showpaths show DUMPLOG file
While not a path exactly, the dumplog file isn't placed somewhere
fixed so being able to see where it is placed could be useful.
This cascaded a bit during testing. Fix one of the warnings from
hardfought (fqn_prefix_names[]). And a few more that came up with
SYSCF disabled (panictrace_gdb, two unused variables if files.c).
PatR [Fri, 15 Nov 2019 18:12:45 +0000 (10:12 -0800)]
hints/macosx10.14 comment
A comment in macosx10.14 describing how to create a signed package
had the last sample command wrong. Fix it now in case that part
carries over to hypothetical--but likely--new macosx10.15 hints.
Also, shorten a couple of wide comment lines in the same area.
PatR [Fri, 15 Nov 2019 00:42:53 +0000 (16:42 -0800)]
more #H9392 - deafness vs music
The report mentioned whistles but I had forgotten all about them by
the time I tried to deal with musical instruments. Plain whistles
had deaf handling but magic whistles didn't.