Commit Graph

3321 Commits

Author SHA1 Message Date
nhmall
fa092f5fe9 housekeeping for 3.6.1
Changes to be committed:
	modified:   Files
	modified:   README
	modified:   dat/history
	modified:   doc/Guidebook.mn
	modified:   doc/Guidebook.tex
	modified:   include/global.h
	modified:   include/obj.h
	modified:   include/patchlevel.h
	modified:   src/invent.c
	modified:   src/objnam.c
	modified:   src/shknam.c
	modified:   src/sounds.c
	modified:   src/spell.c
	modified:   sys/winnt/Install.nt
	modified:   sys/winnt/nethack.def
	modified:   win/macosx/NetHackGuidebook.applescript
	modified:   win/macosx/NetHackTerm.applescript
	modified:   win/win32/mswproc.c
2015-12-16 17:52:34 -05:00
Pasi Kallinen
929be769ec Add option to have autodescribe on by default 2015-12-16 21:42:43 +02:00
PatR
af6887796f scrolls written while blind; scrolls of mail
Make a fix suggested during beta testing:  you can read scrolls while
blind if you know the label, and you can write a scroll with a magic
marker while blind, but the result was flagged as description unknown
so you couldn't read the newly written scroll until regaining sight
or obtaining object identification.  So change writing a previously
discovered scroll while blind to set dknown since a successful write
always yields the type of scroll requested.  Getting lucky while
attempting to write an undiscovered scroll--which has to be done by
scroll's type name (for instance "food detection") rather than by its
label ("YUM YUM")--still leaves the description flagged as unknown
since hero hasn't seen the what sort of label the new scroll has.

Along the way I got side-tracked by the possibilty of writing a scroll
of mail.  It's allowed and yielded the same result as finding such a
scroll in bones, or wishing for one:  when read, it was junk mail from
Larn.  Make one written via marker give different feedback since it
comes from creation of a stamped scroll without any stamps available.

Also, suppress an "argument not used" warning for readmail().
2015-12-16 02:23:32 -08:00
PatR
8f96d4b9ef fix bz157, #H4075 - 'realtime' had strange units
A couple of reports asked what weird unit of measure was used for the
'realtime' value in xlogfile.  It was just seconds, but was accumulating
incorrectly whenever game-state got saved for the checkpoint option.
Now it really is seconds, or rather whatever unit you get for the delta
of two time_t values; usually seconds but not guaranteed to be that.
2015-12-15 17:59:42 -08:00
PatR
3ec592e3f1 fix bz60 and bz61 - meta char feedback
60: getpos() doesn't report the offending keystroke accurately when
rejecting M-something as a movement keystroke while moving the cursor;
61: typing M-N as a command keystroke produces
 |Unknown command 'M-
 |                 '.
where the '.' on the second line clobbers the top line of the map.

I can't reproduce the first one without extending the altmeta hack
[a run-time option to treat two char sequence ESC c as M-c] to getpos()
and nh_poskey(), which I've done for testing but am not including here.

I can't reproduce the second as it's described, but M-^J produces
 |Unknown command 'M-
 |'.--More--
and this fixes that, with a general fix that applies to any meta char.

The diffs include some cleanup/groundwork for maybe extending altmeta.
2015-12-15 03:22:39 -08:00
PatR
c843f56897 fix #H4078 - dull spellbook vs sleep resistance
Reading a dull spellbook could make a sleep resistant hero fall asleep.
2015-12-14 13:27:31 -08:00
nhmall
6f6f74e8d2 slightly change quickmimic() sense wording
Changes to be committed:
	modified:   doc/fixes36.1
	modified:   src/dogmove.c

A bug reporter wrote:
> comments:
> "You sense a little dog appear where Poes was!"
>
> seems strange to me, perhaps it should be "appearing", or the hero shouldn't
> notice at all if it's out of sight.
>
> Not sure it was out of sight, anyway, because I saw the d from the shop
> doorway.
>

Change the wording to:
"You sense that a little dog has appeared where Poes was!"
2015-12-13 21:45:08 -05:00
PatR
50065303e1 commit 8a13a4d2044264cf7427ba6a035021949788b5f1
Author: PatR <rankin@nethack.org>
Date:   Sun Dec 13 06:06:58 2015 -0800

    fix #H4066 - bug eating ring of protection

    Intrinsic protection of 0 (usually from having a gremlin steal divine
    protection, but also possible by eating a +0 ring of protection) does
    not contribute to "magic cancellation", the defense attribute that
    makes some special attacks fail.  That's intended.  Negative intrinsic
    protection (not possible from having divine protection, but turns out
    to be possible from eating negatively enchanted/charged rings of
    protection), did contribute.  That wasn't intended, so stop it.
    (Positive intrinsic protection gives a magic cancellation of 1 if worn
    armor doesn't provide any MC.)
2015-12-13 06:15:54 -08:00
PatR
4ad39ba282 fix part of #H4062 - high priest name refusal
High priests used a different message to refuse accepting a user-supplied
    name than regular temple priests because they're flagged as unique.  The
    effect was cosmetic; it didn't reopen the hole that let you recognize
    which high priest was which via the 'C' command on the Astral Plane.

    [I never received the mail for #H4062 but saw it in bugzilla.]
2015-12-12 20:56:46 -08:00
PatR
807afa22b3 fix #H4047 - dipping inconsistency
Dip the scroll labeled LEP GEX VEN ZEA into the fountain?
Your scroll called light fades.

The first prompt deliberately avoided 'called', 'named', and other
attributes to keep it short, but the discrepancy here is blatant, so
increase the verbosity in order to have the reminder that's included
in the prompt be the same as object name in the followup message.

Bonus fix, noticed while testing it:  water_damage() was reporting
the "{blank,unlabeled} scroll fades" even though blank scrolls are
already as faded as they can get.  Likewise for blank spellbook.
2015-12-12 19:41:35 -08:00
PatR
637f4a4bd6 fix bz55 - wrong plural for slice of cake
Entered in bugzilla prior to release:  "slice of birthday cake" became
"slouse of birthday cake" when made plural.  "slice of pizza" used to
work, but adding an entry for "louse" <-> "lice" to one of the special
handling lists for singular/plural broke "slice" since only a trailing
substring match is performed for entries in that particular list.
2015-12-12 18:59:21 -08:00
PatR
ead5b0f210 fix #H4061 - uncursed scroll of enchant armor
In 3.4.3, reading an uncursed scroll of enchant armor while wearing
a piece of cursed armor performed an uncurse as well as raising
enchantment.  A fairly big patch to redo how pending shop bills were
affected by altering the items on the bill accidentally took away
the uncurse part when modifying the scroll code to use the bless()/
uncurse()/curse() functions instead of manipulating the armor's
blessed and cursed flags directly.
2015-12-12 18:08:11 -08:00
PatR
2219a6a667 naming artifacts vs illiteracy
Requested by a beta tester back in June:  naming Sting or Orcrist
violates illiterate conduct.  I left it at that; any object naming
could be construed as being literate, but I don't think breaking
conduct for doing such would be a good idea.
2015-12-12 01:55:44 -08:00
PatR
757e6f9c4d vampire genocide could produce unkillable critter
Vampires who were currently shape-shifted into a fog cloud, bat, or wolf
became an unkillable fog could, bat, or wolf if the player genocided
vampires.  When such a creature was killed, the attempt to transform it
back into a vampire failed, but the monster continued to be resurrected
anyway.
2015-12-12 00:34:16 -08:00
Jean-Christophe Collet
9558f2d9d8 Fix #H4014: still crashing on MacOS 10.11 2015-12-11 17:02:28 +01:00
PatR
3db5f106df fix #H4039 - symset:default
Options parsing didn't support "default" (shown by the 'O' command)
or "Default symbols" (menu entry for choosing a symbol set via the
'O' command.  Symbol handling is somewhat confusing, but this seems to
do the trick.  They can't be truncated, but they're case-insensitive,
and "Default" and "symbols" can be separated by dash or underscore as
well as space, or run-together with no separator.
2015-12-11 02:36:56 -08:00
PatR
ef5b37a03a fix #H4035 - msg when wand zapped by mon explodes
Message given when you see a cursed wand explode while being zapped
by a monster got suppressed if hero was deaf, even though there's no
reference to sound in that message.  Change it to ignore deafness;
also, change the alternate message when not visible (which uses
You_hear so already gets suppressed when deaf without caller worrying
about it) use "nearby" or "in the distance" with same criteria as
hearing a wand being zapped, instead of always "in the distance".

I also changed the near/far criteria:  threshold to be considered
"far" shrinks from 9 steps to 5 when there's no direct line of sight.
2015-12-10 18:11:12 -08:00
PatR
cee9426694 fix #H4038 - distant name vs Eyes of the Overworld
distant_name() temporarily blinded the hero before calling xname() or
doname() in order to prevent the object being formatted from having
its dknown flag set.  The Eyes of the Overworld override blindness, so
that bit got set for heros wearing them regardless of intention.  This
switches to a file-scope global instead of blindness as the way that
distant_name() tells xname() not to set dknown.

This bug has been present ever since the Eyes were added (3.3.0?).
2015-12-10 01:34:09 -08:00
PatR
c14336fee2 fruit enlightenment
Move the 'if (wizard) { /* give feedback for named fruit */ }' code
in ^X/enlightenment into an #if DEBUG block, and expand the if (wizard)
predicate with '&& explicitdebug("fruit")' to require that 'fruit' be in
DEBUGFILES.  So, build with DEBUG enabled and run via
 |% DEBUGFILES='fruit' nethack
to get it back....

This isn't actually a bug fix and it isn't necessary for 3.6.1, but I
got tired of seeing ^X and end-of-game disclosure of attributes end with
three lines about fruit when I'm not doing anything with named fruit.
2015-12-10 00:36:01 -08:00
Pasi Kallinen
43550bee53 Allow unlimited number of players
This is important for public servers.  Setting the MAXPLAYERS
sysconf value to 0 (or commenting it out) constructs the lock
files with the player UID and player name, so each player may
have one game at a time.
2015-12-09 22:27:26 +02:00
PatR
3ce4fe4180 fix #H4026 - silly plural bug
When a stack of corpses gets zapped by undead turning, the message was
"The <foo> corpses glows iridescently."  Change it to "One of the <foo>
corpses glows iridescently." since only one of the stack gets revived.
2015-12-09 05:56:40 -08:00
PatR
a35c3e184c fix #H3994 - cursed genocide is inconsistent
After reading a cursed scroll of genocide, explicitly choosing "none"
when asked to pick what type of monster to wipe out, you get "sent in
some <rndmonst>".  But picking nothing (or something invalid) 5 times
gave "that's enough tries" without sending in random monsters.  Make
the time-to-give-up behavior be the same as the don't-want-to behavior.

Also, treat picking ESC the same as "none", like blessed genocide does.
2015-12-08 23:12:28 -08:00
PatR
d984cf456e doclassdisco() - missing start_menu() call
Apparently tty doesn't mind if you use add_menu() without preceding
it with start_menu(), because doclassdisco() (the new with 3.6.0 '`'
command) works for me with all four settings of menustyle.
2015-12-08 07:21:48 -08:00
nhmall
c1a5895f3a Release prep step - set BETA_INFO to empty string
Changes to be committed:
	modified:   src/version.c
2015-12-05 10:09:28 -05:00
PatR
9f6f3f5180 PANICTRACE option parsing
Fix the situation where disabling PANICTRACE, which happened implicitly
when BETA  got disabled, caused SYSCF option processing to complain and
quit if the 'sysconf' file contained any PANICTRACE settings.

Now accept all the PANICTRACE options (assuming SYSCF is defined) even
if PANICTRACE is not defined.  Their values are recorded in the 'sysopt'
struct, but only validated when the appropriate macros (PANICTRACE,
PANICTRACE_LIB) are defined.
2015-12-04 22:18:17 -08:00
PatR
841662ff32 "Bad option line" formatting
Change
  |Bad option line:  "foo
  |"
to
  |Bad option line: "foo"
by stripping away the input line's newline before processing it.

(This doesn't address the PANICTRACE options processing issue.)
2015-12-04 18:52:51 -08:00
PatR
171fb90746 !DEBUG warnings
With DEBUG suppressed, I started getting
16      warning: empty body in an if-statement
and 2   warning: empty body in an else-statement
from gcc.

Using braces for an empty block instead of just ';' avoids the warning:
    if (foo)
        debugpline("foo");
is bad,
    if (bar) {
        debugpline("bar");
    }
is good.  ;-)

The changes to lint.h are just precautionary.

modified:
    include/lint.h
    src/attrib.c, bones.c, dbridge.c, dig.c, eat.c,
        makemon.c, mkmaze.c, mon.c, sp_lev.c
2015-12-04 14:58:49 -08:00
PatR
e78e393a81 lint cleanup
A couple of things 'gcc -g' didn't care about 'gcc -O2' mistakenly
thinks 'may be used uninitialized'.
2015-12-02 02:36:29 -08:00
PatR
df415b4c35 sp_lev.c update
Shorten a function name in sp_lev.c that exceeded 31 characters.
That's a limit imposed by the VMS linker and the compiler complains
that it will be truncated.

Make all sp_lev.c functions which aren't listed in extern.h be static
and give all of them a declaration at the top of the file.  I reordered
the ones already declared there in the same order as they occur in the
source, so the diff is quite a bit bigger than the actual changes.
(Once the one with the long name became static, the length of its name
no longer mattered, but I've shortened it anyway.)

Indent a couple of #pragma directives.  Some pre-ANSI compiler didn't
like '#' in column 1 followed by something it didn't understand, even
when that occurred in a conditional block which was in the midst of
being excluded.  (util/*_comp.y recently reminded me of that.  files.c
should get a fix like this too.)
2015-12-02 02:18:24 -08:00
PatR
3903381a2d dungeon overview bug fixes
Reported by a beta tester months ago:  it was possible to recognize
your god's temple on the Astral Plane by stepping into its doorway,
since #overview would show "temple of <your god>" (only if just one
temple had been entered and the altar in it was the only one you'd
seen and it was for your own god; #overview doesn't show "temple of
<other god>", just "a temple").  After this fix it will just show
"a temple" even when you can see the temple's altar, so #overview
can't be used as a shortcut to finding the right temple.

While testing the fix I discovered that amnesia wasn't handled when
forgetting the current level's map, only when other levels got
flagged as forgotten.  The number of altars, fountains, and so on
are recalculated when #overview is executed, so current-level amnesia
worked for those.  But data about known rooms is not recalculated,
so the number of temples and shops you'd visited on the level stayed
instead of being forgotten.  The fix is a bit iffy for the case where
you only forget random spots scattered across the level's map rather
than the whole thing; this just wipes #overview memory of every room
even if parts of rooms are still remembered.
2015-11-29 21:46:24 -08:00
PatR
3ad3b82aef quest message summary debugging code
How that there's nothing left to trigger it, put in some extra quest
messge debugging code.  Could be useful if new roles are added or if
any deliver-by-pline messages get changed to be deliver-by-window.
2015-11-26 04:30:55 -08:00
PatR
dd82c0db89 dog/cat/rat/ape body parts
Another bit prompted by vibrating square testing:
 |You see a strange vibration beneath the little dog's rear claws.

Fix up some body parts:  dog, cat, and yeti-class (includes sasquatch,
monkey and ape, owlbear) already have "paws" instead of "fore claws".
Take away all 'Y' except owlbear from that list and add rodents to it.
Give them "rear paws" instead of "rear claws" for their feet; for legs,
use "foreleg" instead of "forelimb" and "read leg" instead of "rear limb".

For yeti/sasquatch/monkey/ape/carnivorous-ape, switch from paws to hands
since they have opposable thumbs, and switch to arm, leg, foot instead
of forelimb, rear limb, and rear claw.  I've left "fore claw" for finger.
2015-11-25 16:09:33 -08:00
PatR
a7f64606d7 trap creation sanity check
Noticed while testing the look-at vs vibrating square patch:  I was
able to cover stairs with a trap via wizard mode wish.  That wish can
achieve a lot of irregular things, but prevent this particular one.
2015-11-25 14:56:58 -08:00
PatR
6f8ab3d9b2 look_at tweak
When examining a trap with '/' or ';', show
 |a trap (arrow trap)
instead of
 |a trap or a vibrating square (arrow trap)
outside of Gehennom (unless the trap actually is a vibrating square,
which could happen via wizard mode wish).  The extra verbosity is
distracting, and limiting mention of the vibrating square to the region
where it's relevant may give a hint to players getting that far for the
first time.
2015-11-25 12:16:00 -08:00
Pasi Kallinen
943cc6057c More tiny formatting fixes, move function names to start of line 2015-11-25 10:15:41 +02:00
Pasi Kallinen
d4578bbf23 More tiny formatting fixes 2015-11-24 12:04:52 +02:00
Pasi Kallinen
772fea0361 Prevent kraken farming
...or at least make it more inconvenient, by preventing fishy
creatures from revival by undead turning unless they're in a pool.
2015-11-24 11:35:50 +02:00
Pasi Kallinen
3a1e9ccd80 Fix infinite throne looting when confused
This could be used to generate monsters ad infinitum.
2015-11-24 11:16:07 +02:00
Pasi Kallinen
6ed4f24d24 Tiny formatting fix 2015-11-24 09:59:20 +02:00
PatR
74450ef1f5 overlay bit
Advance declaration of a function that's passed as a pointer to another
function.
2015-11-23 16:00:50 -08:00
PatR
3edfcffccc SYSCF WIZARDS
Preformat SYSCF entry 'WIZARDS' so that it can be displayed during panic
feedback without allocating memory for the formatted list at that time.
It also gets displayed for help's "support information" ('?k').

For panic(), push "it may be possible to rebuild" to a second line since
the formatted usernames might make the line long.
2015-11-22 17:23:11 -08:00
PatR
42f758b9b2 build warning 2015-11-22 17:21:44 -08:00
PatR
b30fce4f88 flag panic() and terminate() as "no return"
Mark panic() as never returning so that code analysis might be able
to do a smarter job.  It required splitting done() into two routines
since the first part really can return (but not if PANICKED was the
reason it got called).  done() is now much shorter and ends with a
call to new really_done(), and panic() skips done()'s might-return
part by calling really_done() directly.

Noticed in passing:  the "report error to <list of SYSCF WIZARDS>"
code calls a routine which uses alloc(), which won't work very well
if the reason for panic was because malloc() ran out of memory.
2015-11-22 08:33:42 -08:00
PatR
f22c9c000a avoid panic save panic if external compress fails
On OSX 10.5, save file compression and uncompression fail when I run
under debugger control (for gdb, at least; I don't know why).  I used
'#panic' to try something out.  panic() calls exit_nhwindows(), then
after some messages calls dosave0().  Saving calls docompress_file()
and when that fails on tty it tries to call clear_nhwindow(WIN_MESSAGE)
but WIN_MESSAGE has been torn down already, leading to a nested panic().
Avoid the call to clear_nhwindow() if windows aren't up.
2015-11-22 08:26:12 -08:00
PatR
48745c8f67 valgrind vs genl_putmixed
In the midst of composing a commit message about how I reorganized some
of genl_putmixed()'s code without finding any problem, I realized that
there was a problem.  The character immediately after \G12345678 would
be copied directly to the output buffer without examination.  If that
was the leading backslash for a second encoded sequence, the G and the
hex digits would follow their backslash as just ordinary chars, which
is not what's intended.  Or if instead of a backslash the next character
was the input's terminating '\0', the latter would be copied into the
output and the pointer to the input string would be incremented, then
the next loop iteraction would examined whatever followed.  If valgrind
is smart enough--and it seems to be--it would complain about accessing
a character that putmixed()'s caller hadn't initialized.

The only use of putmixed() I'm sure about is the what-is code showing
a screen symbol with its explanation, which doesn't exercise either
\G12345678\G12345678 or \G12345678\0.  I didn't go hunting to see if
there was someplace that might have an encoded symbol at the end of the
string.  what-is still works after this patch....

The only substantive change is adding ``continue'' but I haven't gone
back and undone the reorg that preceded it.
2015-11-21 23:01:43 -08:00
Pasi Kallinen
08b041f15f Pacify some clang compile warnings, pt 2 2015-11-21 23:50:11 +02:00
Pasi Kallinen
7063488621 Pacify some clang compile warnings 2015-11-21 23:40:06 +02:00
Pasi Kallinen
90302ce86d Declare a variable as static 2015-11-21 20:56:47 +02:00
Pasi Kallinen
70cfeb08d8 Remove useless variable 2015-11-21 20:51:46 +02:00
Pasi Kallinen
e1090de7b3 Declare missing function proto 2015-11-21 20:47:31 +02:00