Commit Graph

11670 Commits

Author SHA1 Message Date
nhmall
8e7612a49c fix a warning in display.c
display.c: In function ‘redraw_map’:
display.c:1460:15: warning: variable ‘glyph’ set but not used [-Wunused-but-set-variable]
 1460 |     int x, y, glyph;
      |               ^~~~~
2021-01-23 08:49:04 -05:00
Pasi Kallinen
a3c8dead91 Remove unused function 2021-01-23 15:19:34 +02:00
Pasi Kallinen
0516fa9e35 Fix leftover variables from trap refactor 2021-01-23 11:32:54 +02:00
Pasi Kallinen
0dd6960cb1 Fix article used for steed when stepping on trap
This was caused by the trap code refactor I did a month ago.
2021-01-23 11:25:53 +02:00
Pasi Kallinen
2b525aab02 Fix missing proto 2021-01-23 10:56:56 +02:00
nhmall
96ee175ce8 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2021-01-22 16:52:55 -05:00
nhw_cron
d76e13e057 This is cron-daily v1-Jan-20-2020. files updated: Files 2021-01-22 16:52:23 -05:00
nhmall
18a4a41b15 compiler settings alignment between macOS.2020 and linux.2020
get the warning flags on linux and macOS into better alignment

move the compiler flags into hints/include/compiler.2020 so that
maintenance changes can be made there and take effect for both
linux and macOS

this will likely trigger some initial new code warnings to be
investigated on either or both platforms
2021-01-22 16:05:30 -05:00
Michael Meyer
77d4b4c955 Allow custom increment amounts in #wizintrinsic
Let users of #wizintrinsic set a specific amount by which they want to
increment each particular timeout, by entering a count/typing in
numerals before selecting the item in the list.  I think doing it this
way should be pretty intuitive to players who are familiar with the
'enter count -> make selection' flow of normal inventory menus in
NetHack, and is simpler than using a separate prompt, as was mentioned
as a possibility in a comment.

When an intrinsic is selected without entering a count, the increment
will continue to default to the previous value of 30; this value is set
via the DEFAULT_TIMEOUT_INCR macro.

I also deleted a redundant declaration of wiz_intrinsic; the duplicate
seems to have been added by mistake in ff6139c6c5.
2021-01-22 22:34:54 +02:00
Pasi Kallinen
ad0c701127 Fix unused param 2021-01-22 18:16:08 +02:00
Pasi Kallinen
8681aec71b Fix uninitialized variable 2021-01-22 17:58:54 +02:00
Patric Mueller
f4e9104957 Bones levels information in xlogfile and enlightenment
- record number of encountered bones levels in xlogfile
  - add bonesless to extended conducts field in xlogfile
  - show bones levels information in enlightenment at end of game or in
    explore and wizmode
2021-01-22 00:22:09 +01:00
Pasi Kallinen
44bb68fe82 Curses: Select menu items via mouse 2021-01-21 12:53:02 +02:00
Dean Luick
3a30038b49 Add a missing fall-through comment
This eliminates a gcc warning.
2021-01-20 22:39:08 -06:00
Dean Luick
f63d435c6d Fix text replacement warning
Using strncpy to cut off copying a terminating NUL yields a gcc
warning.  Just use memcpy instead.
2021-01-20 22:37:37 -06:00
Dean Luick
5dc5ece412 Remove left-over valid file checking
Commit 7054e06e42 ("NetHack minor release checklist items - savefiles")
consolidated valid file checking into the function viable_nhfile().  This
commit removes unused variables left over from that change.
2021-01-20 22:34:07 -06:00
Dean Luick
16ba1a583a Update nhUse
There is no longer any compiler reason to disable nhUse - remove
nhUse's conditional definition.

Update the nhUse definition to "use" a variable without it needing
to be an integer.

This change removes some gcc compiler unused variable and parameter
warnings.
2021-01-20 22:18:34 -06:00
PatR
e0a6ab5e6b fix #K3251 - "some bugs: empty lamp catching fire"
If an empty lamp was hit by fire, the feedback was "the lamp
catches fire!" even though it wouldn't light.

ingite_items() imperfectly duplicated catch_lit().  Just call
the latter.  The resulting message will be slightly different
but that's insignificant.
2021-01-20 14:37:49 -08:00
Pasi Kallinen
57181c5655 Remove Aztec C workaround from core
Aztec C is closed-source and dead for more than 20 years.
2021-01-20 19:19:43 +02:00
Bart House
2b91931207 Fix delayed rendering of cursor with farlook in NetHackW. 2021-01-19 19:09:40 -08:00
PatR
891b8e3913 X11 selectsaved followup 2021-01-19 17:15:51 -08:00
PatR
d1e4623a0e X11: selectsaved
Implement the 'selectsaved' option for X11.  Requires that
SELECTSAVED be defined at compile time.

Behaves the same as for tty and curses except that if you
choose 'quit', the intended "until next time..." message doesn't
get delivered anywhere.
2021-01-19 16:59:36 -08:00
PatR
cb407eeb61 yet more obj->spe documentation (lamps, candles)
Another mystery.  Candles and oil lamps have obj->spe set to 1
but that isn't used by begin_burn() and such so I don't know why.

Magic lamp has spe set to 1 to indicate that there is a djinni
inside, but letting the djinni out converts it into an oil lamp.
I don't know if there is any case where it might actually be 0.
(Wishing yields an oil lamp rather than an empty magic lamp so
that isn't it.  Cancellation magic doesn't affect it either.)
2021-01-19 15:07:58 -08:00
nhmall
a8f4a54e9a new code accidentally swapped dishwashers
Fixes #449
2021-01-18 16:15:02 -05:00
nhmall
cea4c8c488 another Microsoft compiler warning
win/curses/cursmain.c(760): warning C4189: 'win': local variable is initialized but not referenced
2021-01-17 23:14:13 -05:00
nhmall
fb43299451 some Microsoft compiler warnings
src/muse.c(2255) : warning C4702: unreachable code
src/options.c(2549) : warning C4702: unreachable code
src/restore.c(930) : warning C4701: potentially uninitialized local variable 'stway' used
src/sp_lev.c(5118) : warning C4701: potentially uninitialized local variable 'x' used
src/sp_lev.c(5118) : warning C4701: potentially uninitialized local variable 'y' used
src/trap.c(2979) : warning C4701: potentially uninitialized local variable 'cc' used
src/trap.c(2985) : warning C4701: potentially uninitialized local variable 'bcc' used
2021-01-17 22:58:52 -05:00
Dean Luick
3ef0f889e6 Fix gcc sprintf warnings
Gcc 9 has become more vocal with sprintf buffer overflow
checking.  Remove these sprintf warnings by changing the
offending calls to a snprintf wrapper that will explicitly
check the result.
2021-01-16 19:44:56 -06:00
Dean Luick
8143d55d76 Create and use a snprintf wrapper in the core code
Use a wrapper around snprintf to consilidate all use, add
error checking, and remove gcc 9 warnings about not checking
the result.

Replace the prevous use of snprintf added to weapon.c with the
new scheme.

Update a second spot that has a gcc sprintf warning.  While
there, simplify the code.
2021-01-15 11:33:47 -06:00
PatR
35f9115fae partial fix for #K3242 - kops dismissed twice
when taming is used to pacify hostile shopkeeper.  I haven't
figured out how to reproduce and eliminate the double dismissal,
but this will prevent the second one from issuing duplicate "the
Kops (disappointed) vanish into thin air" and also from trigging
the warning "dmonsfree: N removed doesn't match 2N pending."

The first dismissal leaves defunct Kops on the monster list, as
expected; second dismissal found them still there and sent them
away again instead of skipping them as already gone.
2021-01-14 15:45:27 -08:00
PatR
648162b536 fix github issue #400 - Qt text windows hanging
Text windows only accept a few keys (<escape>, <return>, ':', now
<space>) and if they got other keys they passed those up the call
chain, arriving at the map where they were treated as commands
and were executed while the text window was still displayed.  The
cited example was ',' for pickup while the "things that are here"
popup was shown.  The 'foreign' key's command might be executed
successfully but the undismissed popup could become hung.

This fixes that ('foreign' keys will be ignored).  It also lets
<space> be used to dismiss text windows.

Slightly better but far from perfect:  if you perform a search,
then after it runs you need to type <escape> once, or <return>
or <space> twice, or else search again and pick [done] on the
search popup and then <return> or <space> once, to dismiss a
text window via keyboard.  (Prior to this, typing <escape> or
searching again and picking [done] followed by <return> were the
only ways.)  Also, searching for an empty string will now be
treated as if [done] had been picked.

Fixes #400
2021-01-14 15:10:41 -08:00
PatR
c131e6df18 'selectsaved' bug fix
I have to manually uncompress save files before running nethack
under gdb control or they can't be opened.  Normally that works ok,
but if the 'selectsaved' option is enabled, the code to look up
character names from their save files was mangling the file names
when stripping off the non-existent compression suffix, so couldn't
open them.
2021-01-13 17:24:27 -08:00
Pasi Kallinen
e41c029262 Give barrow wights a cold touch
Their attack is described as "the icy touch froze his bones"
in Lord of the Rings
2021-01-13 21:29:07 +02:00
PatR
4216a7aa97 fix #K3241 - potion dip drop due to pickup_burden
Dipping a unicorn horn to transform a potion causes that potion
to be removed from and re-inserted into inventory.  If the hero
was above 'pickup_burden' threshold prior to dipping and
removing the old potion brought encumbrance back under that,
attempting to add the new one back would drop it instead of
re-exceeding the threshold.
2021-01-11 16:19:50 -08:00
Dean Luick
389f6ca647 Fix sprintf warnings in weapon.c 2021-01-08 20:25:36 -06:00
PatR
a00f856ad3 tribute feedback tidbit
After reading a passage from a novel,
 [<title>, by Terry Pratchett]
gets added to message history.  Change that to be
 [<title>, by Terry Pratchett; passage #n]
to make tracking down the seemingly endless mistakes a tiny bit
easier.
2021-01-08 16:51:46 -08:00
PatR
d86f22d81f another tribute typo: A Hat Full of Sky #9 2021-01-08 16:43:27 -08:00
PatR
85d3aa4a97 obj->spe usage again
uball->spe used to be used during restore way back in 2.3e.
There hasn't been any any point in setting it when starting
punishment and clearing it when ending punishment for decades
so get rid of that.

Nearly as ancient--but not quite--back in 3.10 patchlevel N,
obj->spe was set to -1 when the Amulet of Yendor was saved in
a bones file.  That was to flag it as fake, before the cheap
plastic imitation got added as a separate object.

So obj->spe isn't "special for uball and amulet" any more.
2021-01-08 15:45:04 -08:00
PatR
9dee1fb521 \#include "fnamesiz.h"
The inclusion shouldn't really come before *conf.h because the
things it sets up could depend on those.  This is better, but
having Amiga 90% dead and 10% comatose seems to be more trouble
that it's worth.
2021-01-08 14:59:36 -08:00
PatR
05c7a21756 curses: fix unused label 'bail'
when SELECTSAVED isn't defined by using a goto for it even when
an 'if' was easily avoiding the need for that.
2021-01-08 13:57:52 -08:00
PatR
2d1150bd0a unix Makefile.src update
'make depend' found a bunch of stuff besides Qt headers not
being up to date.
2021-01-08 13:51:08 -08:00
PatR
2c02d5daac Qt key handling
Fix the popup versions of qt_yn_function() to handle control
characters by using the same key press event decoding routine
and menus and extended commands.  Moves 'keyValue()' to
qt_key.cpp and its declaration to qt_key.h, requring several
files to start using #include "qt_key.h".

'make depend' update to follow.
2021-01-08 13:47:34 -08:00
PatR
129ff12245 'make depend' fix
The gone but still referenced state of amiconf.h broke 'make depend'.
Fixing that turns it into a comment in the generated dependencies
but that ran into a problem with it being followed by fnamesiz.h
instead of being last in the list containing it.  So in addition to
the depend fix, move #include "fnamesiz.h" from config.h to global.h
in order to have it come before amiconf.h.
2021-01-08 13:33:27 -08:00
PatR
c2989be3fc dowhatdoes ('&') vs prefix characters
I noticed that the & command was claiming that ^A is an unknown
command.  Unlike the old static version, or the replaced-before-
ever-released conditional version, the fully dynamic variation
of '&' didn't know about any of the special commands:  prefix
letters, ESC, and ^A.
2021-01-08 12:44:45 -08:00
PatR
2f76d0e701 Qt: ^V on OSX
I can't take credit for this and still have no idea why it is
needed, but it fixes use of ^V as a command and as input to
to the regular version of yn_function().  In particular, '&'
command reports it as ^V.  Unfortunately when 'popup_dialog' is
set, no control characters seem to be accepted by the part of
NetHackQtYnDialog(Exec+KeyPressEvent) responsible for arbitrary
input.

It also causes getlin() to terminate but I can't think of any
situation where ^V would be considered to be valid input for
getlin() so won't worry about that.

I put it in as '#if MACOSX' because I don't know whether any
other Qt platforms need it.
2021-01-08 01:37:38 -08:00
Patric Mueller
6a2ac5b446 Add missing flag for count support with drop command
The recent getobj refactoring missed the flag GETOBJ_ALLOWCNT for the drop
command.
2021-01-08 02:12:29 +01:00
nhmall
82c544b935 more Guidebook.tex 2021-01-07 18:28:33 -05:00
nhmall
b13966c161 TeX corrections in Guidebook 2021-01-07 18:18:14 -05:00
nhw_cron
86925ed248 This is cron-daily v1-Jan-20-2020. guidebook updated: doc/Guidebook.txt 2021-01-07 17:50:23 -05:00
PatR
d625fca828 obj.h - expand documentation of obj->spe uses
Started out adding spe==2 for eggs but ended up changing other
things too.

FIXME?  The line "special for uball and amulet" baffles me:

    uball->spe is set to 1 during punishment (with an ambiguous
comment "special ball (see save)"), and back to 0 afterwards, but
otherwise seems to be unused.

    "and amulet" is ambiguous; it should either be "and the Amulet"
or "and amulets".  I assume it probably referred to the former but
it doesn't seem to be used for either kind as far as I can tell.
2021-01-07 14:02:52 -08:00
nhmall
bcf49b85c3 fix another regression in pager.c 2021-01-07 15:52:38 -05:00