PatR [Sat, 28 Mar 2015 01:24:53 +0000 (18:24 -0700)]
tty menu hack for ':'
Looting a container generates a menu which contains ': - look inside'
but the recent change to make ':' be a menu command for selecting
items which match a search string made it impossible to pick that item.
(Well, I suppose you could enter a search string which matched it, but
that's a nuisance compared to just directly picking a choice.) This
makes menu selection for tty give precedence to menu choice characters
over mapped menu commands when some character happens to be both. I'm
not sure whether it ought to be expended to group accelerators too, so
didn't do that.
There's bound to be a better way to do this, but it works.
Pasi Kallinen [Fri, 27 Mar 2015 14:08:06 +0000 (16:08 +0200)]
Show t-shirt text at end of game inventory disclose
Restricting the text display only to the end of game disclose,
so it doesn't clutter the inventory during gameplay and so that
the readability of t-shirts is not given away.
Pasi Kallinen [Fri, 27 Mar 2015 13:29:54 +0000 (15:29 +0200)]
TTY: Guard against impossible x coord
If a menu item was longer than terminal width, the menu wasn't
cleared away after it was finished with. This easily happened
when an inventory item was named.
PatR [Fri, 27 Mar 2015 07:21:40 +0000 (00:21 -0700)]
objnam formatting for bag of tricks
Bag of tricks that had been used at least once was being described
as "empty" regardless of charge count, because it always fails the
Has_contents() test. After half this patch fixed that, it started
being flagged as "empty" as soon as the last charge was used rather
than after attempting to use it again after that, since 'cknown' was
being set whenever it was used. Only set that flag when applying
the bag has been observed to fail.
PatR [Thu, 26 Mar 2015 01:04:50 +0000 (18:04 -0700)]
fix acid_damage() crash
My dog bit an acid blob and triggered a crash, caught by SYSCF panictrace
but yielding confusing information. The backtrace included a call from
'rustm()+N' that turned out to be passivemm(), which was deferencing a
null pointer since no weapon was involved.
nhmall [Wed, 25 Mar 2015 02:07:16 +0000 (22:07 -0400)]
no hiding under nothing
On 3/23/2015 6:41 PM, a bug reporter wrote:
> When you're hiding under an item (e.g. via garter snake polyform), and
> that item gets polyshuddered into nonexistence, you continue hiding
> (under nothing).
This addresses the "hiding under nothing" bug, but does not
address this flavor comment also included in the report:
> (Incidentally, it's a bit weird that you use > to aim at items that are
> flavorwise above you at the time.)
nhmall [Tue, 24 Mar 2015 23:20:14 +0000 (19:20 -0400)]
fix invalid pointer dereference in morguemon
On 3/23/2015 6:41 PM, a bug reporter wrote:
> If the game generates a graveyard, the graveyard places a normal
> demon, but all normal demons are extinct at the time, then morguemon (at
> mkroom.c line 423) indexes mons with NON_PM (the return value of
> ndemon() if it can't find a reference), which is an invalid pointer
> dereference. According to the testbench, this mostly seems to happen on
> dlvl 12.
This fixes the code violation, but the logic will now drop down to the
ghost/wraith/zombie code when that happens.
Is that desireable, or should something else happen (for variety)?
PatR [Mon, 23 Mar 2015 01:29:37 +0000 (18:29 -0700)]
{DEC,IBM,MAC}graphics (2 of 2: unixmain)
Unix command line processing required that the initial 'd' of
"-DECgraphics" be lowercase so that it wouldn't conflict with -D for
wizard mode. This retains -D for wizard mode and now also recognizes
"-debug" (case insensitive, but full 5 letters necessary) for the same
thing, and allows "-DECgraphics" to be capitalized as it is throughout
the rest of the program (actual matching is case-insensitive, so "-dec"
and "-decgraphics" still work. It now requires that anything after
"DEC" match the rest of that string instead of accepting "-DECanthing"
as a synonym for "-DECgraphics". Likewise for "-IBMgraphics": when
more than 3 letters are supplied, the extra ones must be an initial
substring of "graphics" rather than arbitrary characters.
The raw_printf() warnings don't actually work as intended, but that
isn't a change from the old behavior so I've left them in for now.
PatR [Mon, 23 Mar 2015 01:22:36 +0000 (18:22 -0700)]
{DEC,IBM,MAC}graphics (1 of 2: core)
DECgraphics, IBMgraphics, and MACgraphics used to be recognized when
at least 3 letters were supplied back when they were true boolean
options. When they got demoted to shortcuts for the symset option,
they started needing 10 (DEC and IBM) or all 11 (MAC), otherwise
triggering "bad syntax in NETHACKOPTIONS" (or config file). Revert
to having the first three letters be sufficient.
nhmall [Sun, 22 Mar 2015 22:11:49 +0000 (18:11 -0400)]
remove stale feature alert
This old feature alert from 3.3.0 is pretty stale, so remove
if from the code because everybody has probably suppressed
it by now.
/* Because 'Q' used to be quit... */
if (flags.suppress_alert < FEATURE_NOTICE_VER(3,3,0))
pline("Note: Please use #quit if you wish to exit the game.");
PatR [Sun, 22 Mar 2015 02:24:08 +0000 (19:24 -0700)]
fix "mysterious force" probabilities in do.c comment
Reported by Alex, the probabilites shown in the comment about the effect
of the mysterious force have been wrong ever since they were added 20 or
so years ago. Lawfuls and neutrals are much more likely to go down just
one level rather than 2 or 3.
PatR [Sat, 21 Mar 2015 22:36:47 +0000 (15:36 -0700)]
wishing fix for "eyes"
No, not a blindness cure. :-} Post-3.4.3 revisions to makesingular()
inadvertently made it impossible to successfully wish for "the Eyes
of the Overworld" because the string got changed into "the Eye of the
Overworld" which doesn't match anything. So don't singularize "eyes".
(After this fix, wishing for "the Eyes of the Aethiopica" no longer
yields the Eye of same, but I think that's the correct behavior.)
nhmall [Sat, 21 Mar 2015 20:17:17 +0000 (16:17 -0400)]
put mystery line back but !WIN32
Since that line of code is used by a lot of different ports, I decided to
recant its removal and just add #ifdef to ensure it isn't compiled on WIN32.
I think other ports might encounter the same issue where the first pass with
filename set to 'sysconf', is then going to overwrite the hard-coded user
config file name, but I can't fix or test those so for those ports, it
will be now be back the way it was.
nhmall [Sat, 21 Mar 2015 20:01:03 +0000 (16:01 -0400)]
remove a troublesome line of code
Whenever SYSCF was enabled on Windows, the option
processing would go bonkers with illegal options
at startup. I noticed it months ago, and Derek
had it happen the other evening.
It turns out, the hard-coded 'defaults.nh' setting
was being overwritten with the name sysconf on
the first SET_IN_SYS pass, so all subsequent passes
were re-opening the SYSC_FILE instead of the
user config file.
I opted to take it out as I couldn't ascertain
why it was there in the first place.
PatR [Thu, 19 Mar 2015 22:54:17 +0000 (15:54 -0700)]
acid explosion messages from water_damage()
Restore the variant phrasing used when more than one stack of potions of
acid explode while being inflicted with water damage. First message:
"a potion explodes" or "some potions explode"; second and subsequent
messages: "another potion explodes" or "more potions explode". This
trivial feature stopped working when erosion handling was overhauled and
old water_damage was split into current water_damage_chain+water_damage.
Augment the message so that vague "potion" is only used when the object's
dknown flag isn't set (ie, object hasn't been seen yet). Use "<color>
potion" or "potion of acid" otherwise, depending upon whether such potions
have been fully discovered.
PatR [Mon, 16 Mar 2015 22:28:01 +0000 (15:28 -0700)]
allow DEBUGFILES to be overridden via getenv()
If getenv("DEBUGFILES") yields a value then it takes precedence over
sysconf.DEBUGFILES or sys.c's #define DEBUGFILES. (It probably should
only be controlled via environment since it is not a system-wide
attribute, but I haven't taken out the SYSCF handling for it.)
PatR [Mon, 16 Mar 2015 09:29:10 +0000 (02:29 -0700)]
fix #H3724 - gold pile stacking bug
Bug report included a pointer to a fix; this patch is a superset.
Gold pieces dropped on an altar by the player got their bknown flag set,
which is incorrect since bless/curse doesn't apply to coins. If a
monster (in reported case, a slain temple priest) dropped gold there too
then the two stacks wouldn't merge. For the normal !GOLDOBJ config, the
problem goes away as soon as the gold gets picked up. I didn't test for
GOLDOBJ but think two inventory slots containing gold can result.
The superset part is to not break agnostic conduct by dropping gold
on an altar since no information is revealed when doing that.
[This was one of the very last patches checked into the old cvs repository,
where the somewhat out of date message above was accidentally omitted.]
PatR [Mon, 16 Mar 2015 01:02:26 +0000 (18:02 -0700)]
DEBUG/debugpline() fixup
* Replace variadic debugpline() with fixed argument debugpline0(str),
debugpline1(fmt,arg), and so on so that C99 support isn't required;
* showdebug() becomes a function rather than a macro and handles a
bit more;
* two debugpline() calls in light.c have been changed to impossible();
* DEBUGFILES macro (in sys.c) can substitute for SYSCF's DEBUGFILES
setting in !SYSCF configuration (I hope that's temporary).
nhmall [Sun, 15 Mar 2015 16:36:45 +0000 (12:36 -0400)]
catch up on half-physical damage docs
This is catching up on some things that were changed
in development years ago that Dave C. suggested be
documented.
For the record:
-The things that were evaluated and ruled out
are now documented in include/youprop.h so they don't
come up again.
- The things that were evaluated and deemed to be susceptible
to the intrinsic and thus led to a modification in the code
are listed below in this commit message.
Modifications:
- A crystal ball exploding on being applied
- Artifacts' blasting
- Being a fish out of water
- Being hit by Mjollnir on the return
- Being thwacked by an iron ball chained to you
- Boiling/freezing potions
- Broken wands
- Bumping head on ceiling by cursed levitation
- Burning (un)holy water
- Chest/door/tin traps
- Dipping a lit lamp into a potion of oil
- Exploding rings and wands (under all circumstances)
- Exploding spellbooks
- Falling downstairs
- Falling into a (spiked) pit
- Falling off or failing to mount a steed
- Falling on a sink while levitating
- Getting squished in a pit under a boulder
- Hitting your foot with a bullwhip
- Hitting yourself with your pick-axe
- Hooking yourself with a grappling hook
- iron-ball-pulling yourself out of a bear trap
- Jumping/Newton's-Thirding into something solid
- Kicking something that makes you go "Ouch!"
- Land mine explosion
- Sitting in a spiked pit
- Stinking cloud damage
- Thrown potion (bottle)
- Zapping yourself with a wand, horn or spell
- Jumping yourself out of a bear trap
nhmall [Sat, 14 Mar 2015 02:27:09 +0000 (22:27 -0400)]
fix messaging in obstructed() in lock.c
From ais523's recent list of bugs:
If a long worm tail is blocking the door, and you're blind and not
telepathic, attempting to close the door marks the position of its head.
From an email received in late September 2014 before the git conversion:
> I was trying to close a door, not noticing that there was a garter
> snake there, and this message resulted:
> The garter snake stands in the way!
> I haven't tried it with any other monsters without feet, but
> "stands in the way" appears to be the wrong way to describe
> this situation...
Both of the above were found in the same function in lock.c
Pasi Kallinen [Wed, 11 Mar 2015 15:16:05 +0000 (17:16 +0200)]
getpos improvements: automatic description
Pressing '@' will move the cursor on top of the hero.
Pressing '#' will toggle automatic description mode, where
the feature under the cursor is automatically described
when the cursor is moved.