Commit Graph

16505 Commits

Author SHA1 Message Date
PatR
2e6802d2b3 potential DECgraphics optimization
Add a comment about something that occurred to me when fixing the
^C-during-DECgraphics-output situation several days ago.  I don't
think there's any compelling reason to avoid this optimization, but
this only describes it without actually implementing it.
2024-02-17 03:28:40 -08:00
nhmall
20d2ac726c have tile2bmp describe the bmp file layout 2024-02-16 22:15:09 -05:00
nhmall
ef19265438 restore ability to use gdb on NetHack built with mingw-w64 2024-02-16 20:34:58 -05:00
PatR
d253e947da more getpos() highlighting plus jumping in place
Simplify the valid-position highlighting via '$' by combining the
tmp_at(start) and tmp_at(populate) steps.

Add highlighting for a couple of targetting operations that would
give valid/invalid feedback via autodescribe but weren't displaying
highlight markers for $.

I made several jumping changes, most of them dealing with picking
hero's own spot.
2024-02-16 15:36:17 -08:00
PatR
1d5f45aa78 getpos() highlighting of valid positions
Redo getpos() highlighting.  If bgcolors is Off, '$' toggles between
no highlighting and showing dollar signs at valid spots.  ^R removes
those if they're present.  When bgcolors is On, '$' cycles among
three settings:  highlighting via background color, no highlighting,
and highlighting by drawing dollar sign characters.  ^R switches to
background color mode.

This doesn't directly solve the problem of background color causing
conflict with the foreground color of some objects or monsters, but
being able to get rid of the background with a keystroke should be an
improvement.

'bgcolors' defaults to On, which was a problem for tty when 'color'
was Off.  Turn it Off (in the core) for text map if color is Off and
bgcolors hasn't been explicitly set.  Conversely, Qt was leaving
color Off and then using color with abandon.  Turn in On (in the core)
for tiled map if it hasn't been given an explicit value.  Those two
changes should cope with most situations and still let the player
override.
2024-02-16 14:56:20 -08:00
PatR
2e64d35dd2 S_goodpos symbol and tile
Change the goodpos symbol, which is used to mark valid locations for
some operations when getpos() is having the player pick a spot, from
green question mark to blue dollar sign.  Dollar sign is the default
keystroke to toggle those markers off and on.
2024-02-16 14:14:05 -08:00
nhmall
b6ad791f5f quiet some Windows warnings; fix fatal link error 2024-02-15 21:57:36 -05:00
nhmall
437a403286 follow-up - avoid onefile issues 2024-02-15 21:56:47 -05:00
nhmall
48c01b4ac1 quiet some new warnings
end.c:177:16: warning: unused parameter 'why' [-Wunused-parameter]
  177 | NH_abort(char *why)
      |          ~~~~~~^~~
end.c: At top level:
end.c:1191:1: warning: 'get_saved_pline' defined but not used [-Wunused-function]
 1191 | get_saved_pline(int lineno){
      | ^~~~~~~~~~~~~~~
options.c:1263:1: warning: 'optfn_crash_urlmax' defined but not used [-Wunused-function]
 1263 | optfn_crash_urlmax(int optidx UNUSED, int req, boolean negated UNUSED, char *opts, char *op)
      | ^~~~~~~~~~~~~~~~~~
options.c:1240:1: warning: 'optfn_crash_name' defined but not used [-Wunused-function]
 1240 | optfn_crash_name(int optidx UNUSED, int req, boolean negated UNUSED, char *opts, char *op)
      | ^~~~~~~~~~~~~~~~
options.c:1217:1: warning: 'optfn_crash_email' defined but not used [-Wunused-function]
 1217 | optfn_crash_email(int optidx UNUSED, int req, boolean negated UNUSED, char *opts, char *op)
      | ^~~~~~~~~~~~~~~~~
2024-02-15 21:25:22 -05:00
nhkeni
9b238bba09 turn off CRASHREPORT for CI minimal build 2024-02-15 20:43:49 -05:00
nhkeni
72ae3c7282 if makedefs doesn't exist, force NOCRASHREPORT 2024-02-15 20:42:57 -05:00
nhkeni
3a3f5c9923 azure-pipelines.yml: cope with white-space after # 2024-02-15 20:24:41 -05:00
nhkeni
c02220499b Add CROSSCOMPILE to mdgrep, then use it to stop CRASHREPORT when cross-compiling 2024-02-15 19:37:43 -05:00
nhkeni
e378b782fc Yes, apparently there are configurations that still need the NH_abort() macro 2024-02-15 19:00:08 -05:00
nhkeni
a638629e47 unscramble NOCRASHREPORT logic in config.h 2024-02-15 18:53:49 -05:00
nhkeni
727740749e Try to fix linux for installations that don't have openssl includes. 2024-02-15 18:08:58 -05:00
nhkeni
252f70b4b3 Turn off debugging flag in Makefile.mingw32 - that should gix the MinGW build 2024-02-15 17:37:40 -05:00
nhkeni
9c0d2389cb hopefully fix broken MSDOS and MinGW compiles (linux still broken) 2024-02-15 17:07:02 -05:00
nhkeni
3d3ce2369c Merge branch 'keni-wincw2' into NetHack-3.7
Lots of manually resolved conflicts.
2024-02-15 16:25:12 -05:00
nhmall
b96762cdf0 update tested versions of Visual Studio 2024-02-15 2024-02-15 09:29:34 -05:00
PatR
bf8a634760 nethack --version:dump
Add the 'dump' argument to the existing '--version' command-line
option to display the magic numbers used when validating save and
bones files for compatibility.

Nothing exciting, just a line of 5 hex values.  I was going to also
list the values for however many save and bones files are specified
on the command line but it seems to need more effort than I care to
expend.  And I hadn't made up my mind whether that should be done by
nethack, recover, or some new standalone program.  [Single line of
relatively raw output is so that they could be compared more easily.]

nethack --version:bad-argument was writing a message to stdout and
then starting play--which immediately overwrites stdout.  Have it
quit instead.  Player wasn't trying to start a game and quitting is
what it does with --version:good-argument.
2024-02-13 15:58:10 -08:00
Pasi Kallinen
d511944dda Add missing initializer for field w_what 2024-02-12 12:57:50 +02:00
nhmall
a8d3d4c8af Windows Makefile.mingw32 2024-02-11 18:20:21 -05:00
nhmall
f2b1150950 include MAXOCLASSES in --dumpenums 2024-02-11 00:10:17 -05:00
PatR
2d82528920 uskin sanity check
'uskin' isn't part of worn[] so wasn't being checked with the other
slot pointers.  Add that, although it'll be excluded by default and
need to have EXTRA_SANITY_CHECKS defined to include it.
2024-02-10 18:04:10 -08:00
nhmall
3119bc1ec2 more Windows Makefile updates
Default to INTERNET_AVAILABLE=Y. If the build computer is not
online with the internet available, an explicit
INTERNET_AVAILABLE=N
will be required for the build, if pdcurses and Lua are not already
staged in the lib folder. That can be done by editing the appropriate line
in the Makefile, or by altering the command line:
    nmake INTERNET_AVAILABLE=N install

With Makefile.nmake:

Store pdcurses wingui and pdcurses wincon object files in separate
directories.

Rename the two pdcurses static libraries.

Because of the static library changes, the following will be required
prior to the next build:
    nmake spotless
2024-02-10 20:20:14 -05:00
nhmall
9e6872d982 Windows Install.windows correction 2024-02-10 12:44:13 -05:00
nhmall
cc7618438c Windows Install.windows and nhsetup.bat updates 2024-02-10 12:39:49 -05:00
PatR
e2a3c98aac worn/wielded pointer sanity checks
Check the various uarm, uwep, and so forth pointers to make sure that
they point to items in hero's inventory and that those items have the
corresponding W_ARM, W_WEP, &c bit set in their owornmask field.
Also check whether any other items in inventory have the same bit set.
[Some of this is already handled by sanity_check_worn() in mkobj.c.]

Also validate two-weapon combat mode.  I don't recall ever seeing any
problems reported about it though.

Does not validate ball and chain.  Those should have their own sanity
checks that validate a bunch of other stuff besides just worn slots.
They already get some checking by the normal object tests.

This works ok with 'sanity_check' set and items worn and wielded
normally.  The only insane situation tested was by reverting the
confused-looting-with-quivered-gold fix from earlier today.  I haven't
used a debugger to force other such problems so this isn't very
thoroughly tested.
2024-02-09 23:32:16 -08:00
PatR
c490265e35 Q enhancement
Noticed while testing confused #loot:  when using 'Q' to populate
quiver, or 'f' when quiver is empty, don't bother asking what to
ready/fire if inventory is empty.

And when inventory isn't empty, don't list '-' as a likely candidate
if quiver is already empty.

'w' behaves differently.  '-' is treated as a likely candidate when
already not wielding anything, and even when inventory is completely
empty.
2024-02-09 16:46:22 -08:00
PatR
9326f80ecc lava_effects() bit
lava_effects() item destrunction had the logic for handling Book of
the Dead wrong.  (However, that didn't matter since the obj_resists()
check earlier would prevent it from being burned up.  Fix it anyway.)
2024-02-09 15:52:17 -08:00
PatR
381851348b fix #K4103 - crash after confused #loot of throne
If gold is moved into throne's coffer chest (or added to exchequer
monster's minvent) while quivered by the hero, it wasn't being unworn
to remove it from quiver slot.  That could lead to a crash.  Example
was segfault during 'f' command.

freeinv() expects caller to unwear item being removed from inventory;
reverse_loot() wasn't doing so.
2024-02-09 15:48:47 -08:00
nhmall
49fa532fa8 update Windows Makefiles 2024-02-09 17:42:12 -05:00
PatR
bffa88b04e regions vs long worm tails
If any part of a long worm is within a posion gas cloud region,
include it just once no matter how many segments are inside.  The
tail will take harm from poison gas, but only once rather than for
repeated for every segment inside the region.

Unlike with detection, show long worm tail if hero is adjacent to
it in a gas cloud region and would see that tail segment if the
region wasn't inhibiting visibility.
2024-02-08 23:44:22 -08:00
PatR
d682d8b3d3 curses: build fix for italics attribute support
I've been building tty-only for a while in order to speed up
builds, so a recent change to the curses interface that broke
compile on older OSX went unnoticed.  The <curses.h> on my
OSX 10.11.6 system does not define A_ITALIC.
2024-02-08 13:10:42 -08:00
PatR
ad8bcc6b3f comment typo of the day
I have no idea how this got in.  It's not just a typo; what's beyond
thinko?
2024-02-08 12:32:43 -08:00
PatR
fd5526db7c fix for #H9430 and github issue #1207 - gas clouds
Reported yesterday as issue #1207 by elunna and over four years ago
in #H9430:  monsters in gas clouds that should be shown by Warning
aren't.  And in some discussion of #H9430 back then:  monsters
adjacent to the hero while in gas clouds aren't shown on the map,
but combat and other interaction describes them as if they were.
There have been changes since then--to prevent seeing things on the
far side of gas clouds as if there were no clouds in the way--but
the basic problems with warning and adjacency weren't addressed.

This is a band-aid (tm) that probably makes things livable.  Don't
allow gas region display to override monsters that are sensed via
warning or when the hero is next to them.  That part doesn't work
correctly if the hero isn't blind and is inside the cloud while the
monster is adjacent but outside.  I think it will take more than a
band-aid to deal with that sensibly.

Closes #1207
2024-02-08 07:04:15 -08:00
Pasi Kallinen
b37f1408d8 Self-recover for linux
Compile-time option SELF_RECOVER was implemented for Windows;
add it to unix systems too, with it being on by default when
compiling with the linux hints file.
2024-02-08 11:34:59 +02:00
PatR
5212e4b3db fix github issue #1204 - reflected poison gas
Reported by elunna:  a poison gas breath attack that was reflected
by the target still left that target enveloped in a poison gas cloud.

This makes the gas trail not extend to the target if the attack hits
and is reflected.  But if the attack misses then the cloud does reach
the target, which seems weird to me.  However, being in the cloud is
a separate event that isn't deterred by reflection.

Closes #1204
2024-02-07 11:58:12 -08:00
Pasi Kallinen
6b9f411a32 Accessibility: mon_movement
Adds a new boolean option, mon_movement. When hero notices monster
movement, give a message. Use with spot_monsters and accessiblemsg.
2024-02-07 19:50:38 +02:00
nhkeni
dbe5c98dca add CRASHREPORT directly to browser
add CRASHREPORT for Windows
add ^P info to report (via DUMPLOG)

new options: crash_email, crash_name, crash_urlmax
new game command: #bugreport
new config option: CRASHREPORT_EXEC_NOSTDERR
new command line option: --bidshow

deleted helper scripts:
    NetHackCrashReport.Javascript
    nhcrashreport.lua

misc:
    update CRASHREPORTURL (will need to be updated before release)
    update bitrot in winchain
    winchain for Windows
    add missing synch_wait for NetHackW --showpaths
    add PANICTRACE (and CRASHREPORT) in mdlib.c:build_opts

missing:
    packaging (Windows needs the pdb file)
    no testing with MSVC command line build

port status:
    linux: working, but glibc's backtrace doesn't show static functions
    Windows VS: working.  pdb file is large - looking into options
    MacOS: working
    msdos: not supported
    VMS: not supported
    MSVC: planned, but not attempted
    MSYS2: working, but libbacktrace not showing symbols (yet?)
2024-02-06 18:33:59 -05:00
nhmall
e5e63b886e Guidebook update Feb 6, 2024 2024-02-06 15:39:50 -05:00
nhmall
b783b3daad update tested versions of Visual Studio 2024-02-06 2024-02-06 15:33:47 -05:00
nhmall
1f255dcd03 comment bit 2024-02-06 15:03:59 -05:00
nhmall
a62ded6d28 ini_inv_mkobj_filter() bit
The try count of 1000 is never going to be reached.

The obj result, if it were ever to be reached, would have
been unfiltered and potentially incorrect.

There is no harm in having the result, in that theoretical edge
case, not be one of the obj values that was intended to be
filtered out.

No practical change results from this, and pancake was used
because it is innocuous.
2024-02-06 14:33:16 -05:00
nhmall
f6577e1989 update for --dumpenums
Include a value added back on January 11, 2024
2024-02-06 14:19:16 -05:00
PatR
dfdb6f0ab6 couple of comments in steal()
Teleporting due to loss of protection against water or lava isn't
the only way a visible thief might produce "It stole <item>" prior
to the fixup the comment explains.

The late comment about uball and uchain becoming Null was there to
explain why they weren't referenced when inserting the phrase
| (was_punished && !Punished) ? " removed your chain and" : "",
into "<Mon> stole a heavy iron ball."  That isn't there anymore so
get rid of the comment.
2024-02-06 10:46:01 -08:00
nhmall
3a9e53a629 issue #1205 - crash using the curses interface
curses_yn_function() was returning a value that wasn't in the
subset of legal return values. This fixes that.

The unexpected return value of 32 (or space) then brought to
light an indexing error in the core that's been there a while,
apparently since at least 3.2.0, and that caused a null pointer
dereference in a strlen() call, which is what actually caused
the crash in issue #1205. This fixes that too.

Close #1205
2024-02-06 13:12:04 -05:00
Pasi Kallinen
6c874267b8 Correct petattr doc in Guidebook 2024-02-06 08:54:32 +02:00
Pasi Kallinen
8c815d3bfa Init petattr in core, not in curses
My recent change to petattr caused a crash in curses when no
petattr was used in config file - because curses was setting
petattr to curses-specific value.  Init the setting in core
instead.
2024-02-06 08:50:16 +02:00