Commit Graph

3847 Commits

Author SHA1 Message Date
PatR
3fbcce5e87 autodescribe vs DUMPLOG
Keep getpos's autodescribe feedback out of the DUMPLOG message history.
Unfortunately it still gets put in interface-specific message history
and is liable to fill up the buffer there, forcing actual old messages
to be flushed away.
2017-04-08 19:54:18 -07:00
PatR
5cb4168c58 autodescribe vs detection
Temporary map views for detection or #terrain allow moving the cursor
around to get the brief location description provided by getpos's
autodescribe feature and were doing so by forcing the 'autodescribe'
option to True, then leaving it that way.  Save the option value prior
to such operations and restore it after instead of leaving it changed.
2017-04-08 19:39:43 -07:00
PatR
e1fbfcc8b5 fix #H5264 fix
MSGTYPE handling was being suppressed, except during prompting when
it was intended to be suppressed.
2017-04-05 12:44:55 -07:00
PatR
b708f8b39b partial fix for #H5216 - sortloot inconsistency
The tie-breaker for the qsort comparison routine used for 'sortloot'
had its logic backwards.  Instead of retaining the original relative
order for tied items, it inadvertently reversed them.  So a chest
containing
  club
  dagger named A
  dagger named B
  dagger named C
  long sword
would alternate between that order and
  club
  dagger named C
  dagger named B
  dagger named A
  long sword
each time the chest's contents were examined.  This fixes that, and
also simplifies the unnecessarily convoluted bless/curse state handling.

The other half of the report was a request that 'sortloot:n' not do
any sorting.  Right now, if the player has 'sortpack' set then
'sortloot:n' results in grouping into object classes within pack order
rather than not sorting at all.  (Also, armor and weapons are further
ordered within their groups:  armor by slot [helms, gloves, shields, &c]
and weapons by function [ammo, launchers, missiles, 'ordinary', pole-
arms].)  I think the proper fix is to add a new setting for 'sortpack'
which yields the current behavior before changing 'n' to leave things
in their unsorted order.
2017-03-30 16:12:21 -07:00
PatR
6ba906b234 maybe fix #H5264 - screen clears on prompting
I couldn't reproduce the reported problem of the "In what direction?"
being issued after the screen was cleared, but bypassing pline() in
favor of putstr(WIN_MESSAGE) for tty prompts did also bypass
  if (vision_full_recalc) vision_recalc(0);
  if (u.ux) flush_screen(1);
done in pline().  Inadvertent loss of the latter could conceivably be
responsible for the problem.  If so, the escape code used by cl_end()
may be broken for somebody's termcap or terminfo setup since clearing
to the end of the line in the message window shouldn't erase the rest
of the screen.

Regardless, the prompting change also bypassed the ability to show
the prompt with raw_printf() if the display wasn't fully intialized
yet, so some change to the revised prompting was necessary anyway.

Switching back from putstr(WIN_MESSAGE) to pline() resulted in
duplicated entries in DUMPLOG message history, one with bare prompt
followed by another with response appended, so more tweaking was
needed.  The result is use of new custompline() instead of normal
pline().  custompline() accepts some message handling flags to give
more control over pline()'s behavior.  It's a more general variation
of Norep() but its caller needs to specify an extra argument.
2017-03-30 14:14:38 -07:00
PatR
82620d16f5 tty prompting fix and DUMPLOG of prompts+answers
Update DUMPLOG's message history to include player responses to
most queries.  For tty, both getlin() and yn_function().  For other
interfaces, only yn_function() is covered.  (It's intercepted by a
core routine that can take care of the logging; getlin() isn't.)
Also includes saved messages from previous session(s), for the
interfaces which support that (tty), to fill out the logging when
a game ends shortly after a save/restore cycle.

The tty interface was using pline() to display prompt strings.
Having 'MSGTYPE=hide "#"' or 'MSGTYPE=hide "yn"' in .nethackrc
would suppress many prompt strings (in the two examples mentioned,
entering extended commands or the vast majority of yes/no questions,
respectively) and generally lead to substantial confusion even if
done intentionally, so switch to putstr(WIN_MESSAGE) instead.
2017-03-20 19:11:48 -07:00
PatR
a03d20d7ab fix Bell of Opening segfault
Noticed on nethack.alt.org; the Bell of Opening could trigger a
segfault if applied near a trap door or bear trap (and a few others)
that had no monster at the trap location.  Reproducible if done
while mounted; {open,close}{fall,hold}ingtrap() would try to access
monst->mx and monst->my of a Null monst pointer if given one when
u.usteed was non-Null.
2017-03-17 03:20:11 -07:00
PatR
dd8a95eec4 fix #H5188 - getting an artifact break illiterate
To-be-3.6.1 bug, caused by a patch (of mine...) incorporated about
a week after 3.6.0 was released that was intended to be for naming
Sting or Orcist.  Any artifact creation ended up breaking illiterate
conduct whether user-assigned naming was involved or not (because
oname() is always used to apply the name, not just when do_name() is
executing).

This should be handled differently but I don't want to go through
the dozen and half or so calls to oname() to add an extra argument.
2017-03-14 05:27:45 -07:00
PatR
4b87255105 more control key formatting
The previous fix to use highc(UNCTRL(x)) worked for ^A through ^Z,
but not for NUL (yielded ^` instead of usual ^@) or ^[ through ^_
(yielded lowercase ^{ and so on).  The problem was UNCTRL(); it
shouldn't have been forcing on the lowercase bit to begin with.
Also, the code that used UNMETA() for formatting wouldn't work as
intended for M-control char since it stripped off the 8th bit but
didn't apply any fixup for control chars.

Just get rid of ISCTRL/ISMETA/UNCTRL/UNMETA and use the existing
visctrl() routine instead.  (Its 3.6.0 edition didn't handle
M-control char, but the to-be-3.6.1 branch has done so since a
week or two after the 3.6.0 release.)
2017-03-13 15:43:08 -07:00
Pasi Kallinen
08fe086124 Show control key combos with uppercase alpha
Instead of ^r, show ^R, as that one is used everywhere.
2017-03-13 20:32:46 +02:00
PatR
278b6d52eb dumplog message history groundwork
Separate the message logging out of pline so that other things (for
instance, one-line summary for quest block messages) can be logged.
The code that utilizes this isn't ready for prime time yet.

For FREE_ALL_MEMORY, release DUMPLOG message history when saving.
(Actually, this frees it unconditionally rather just doing so for
FREE_ALL_MEMORY.)  It was being freed when logged at end of game,
but not during save.  If dumplog message history and interface
message history get integrated, the existing message history
save/restore handling should become applicable instead.
2017-03-10 16:41:49 -08:00
PatR
9623154bbc vanquished monsters tidbit
Use the same terminology ("creatures" rather than "monsters") for
the two "no <foo> {have been, were} vanquished" messages as for the
"disclose vanquished <foo>" prompt and its "M <foo> vanquished"
summary.
2017-03-10 16:35:49 -08:00
PatR
ed300e5fa8 dumplog fixes: genocide list, survivor's tombstone
The dumplog data was including a final tombstone unconditionally,
which looked awfully strange for characters who didn't die.  Make
it conditional, like actual end-of-game tombstone.  (One difference
though:  dumplog has a tombstone for hero who died from genocide,
end-of-game does not.  I think the latter should display one even
though no grave gets generated.)  [Potential for future enhancement:
add some alternate ascii art in place of tombstone for survivors.]

The list of genocided and/or extincted species was never shown
since caller passed 'a' to list_genocided() and it expected 'y'.
Also, once shown, the list entries were lacking indentation that
other sections of the dump generally have.

Both vanquished monsters and genocided/extinct monsters included
a blank line separator even when there was no feedback, making a
noticeable gap in the dumplog text.  Have them report "no creatures
vanquished" and "no species genocided", when applicable, so that
their separator lines always have something to separate.

When dumping, omit a couple of blank lines each from vanquished
creatures list, genocided species list, and tombstone so the
relevant sections of the dump are more compact.
2017-03-06 00:22:00 -08:00
PatR
10706ef095 more DUMPLOG lint
The recently added dumplog code assumed that 'time_t' is 'long int'
or at least will give sensible results when formatted with '%ld'.
This is more of a Band-Aid(tm) than a proper fix.
2017-03-04 19:45:15 -08:00
PatR
f55da584f4 dumplog's saved_plines[]
Use a simple ring buffer instead of a flat array that needed to have
49 pointers shifted down a slot every time a pline message was issued.

'saved_plines[saved_pline_index]' is the oldest message in the buffer
and the next slot to use when adding a new one.
2017-02-27 02:54:14 -08:00
PatR
92c5a56364 miscellaneous formatting 2017-02-25 18:29:31 -08:00
PatR
fd2cfba544 dumplog lint and formatting 2017-02-25 18:27:21 -08:00
Pasi Kallinen
7d8b4d4f97 Add end-of-game dumplogs
This is based on the "new" dumplog patch for 3.6.0, by Maxime Bacoux.

Define DUMPLOG to enable. By default only enabled for the TTY linux.
2017-02-19 15:33:27 +02:00
PatR
8c92d2921f fix #H5082 - growing into opposite sex monster
When a female dwarf grows (via level gain) into a dwarf lord, it
changes sex as well as base monster form because all dwarf lords
are male.  The earlier fix for #H4276 (16-Mar-2016, to give an
alternate grow-up message acknowledging the change) used the wrong
monster form (monst's old one instead of new one).
2017-02-17 12:24:24 -08:00
PatR
440d9d74bd fix g.cubes eating green slime
Back when dead green slime left a corpse, gelatinous cubes wouldn't
eat that, but they would eat globs of green slime without being
affected.  Add the missing glob check so g.cubes will engulf globs
of green slime instead of eating those.
2017-02-08 13:10:15 -08:00
Pasi Kallinen
76d7044872 Fix #H5056/bz1086: Bug in Achievement Recording
Bug report was:

> "Completed sokoban" achievement was logged when picking up
> a randomly generated bag of holding in the gnomish mines.

The picking-up code was missing checks for the branches, so
you could get the achievements outside the correct branches.
2017-02-06 16:52:40 +02:00
Pasi Kallinen
0714e38d28 Allow changing max name len via hints file 2017-02-05 09:59:56 +02:00
Pasi Kallinen
ac2fc526eb Fix complaint about uninitialized variable 2017-01-27 07:35:46 +02:00
Pasi Kallinen
fedcfac0f3 Fix use of freed memory when snuffing a potion of oil 2017-01-24 20:19:37 +02:00
Pasi Kallinen
02195d7351 Prevent a segfault with leashed vanished monster
It's apparently somehow possible to have a leash "attached" to
a monster not present on the current level. Complain instead of
segfaulting. (This is a post-3.6.0 bug)
2017-01-19 19:49:19 +02:00
Pasi Kallinen
c6f26c05d7 Accessibility: option to prevent status line updates
Apparently some screen readers keep reading the status lines
at the bottom of the screen when parts of those change.
Add an option to prevent updates to those lines.
2017-01-10 22:19:03 +02:00
Pasi Kallinen
3ea12fe048 Show all statusline info in #attributes 2017-01-10 20:45:16 +02:00
Pasi Kallinen
131ab0a20e Fix mnearto return value confusion
This caused appeased shopkeepers returning to their shops being killed.
2017-01-01 00:21:57 +02:00
Pasi Kallinen
79870d33be Silence Yet Another Valgrind complaint 2016-12-29 19:19:00 +02:00
Pasi Kallinen
24f934dfea Silence some Valgrind errors
Need to have the allocated memory explicitly cleared for Valgrind
to know it.  We should probably start using calloc or something...
2016-12-28 22:52:08 +02:00
karnov
7cb97cbd14 Modified player name list to include new team members. 2016-12-27 23:12:16 -05:00
Pasi Kallinen
1a1adfee3e Fix valgrind complaint in wizmode terrain
The code was writing characters into row[x-1] in the loop, but putting the
string terminator at row[x], leaving one character between uninitialized.
2016-12-23 13:34:10 +02:00
Pasi Kallinen
f4632732ac Fix wishing for tins of specific type
I believe this bug already existed, but was only exposed by
my wishing parser change post-3.6.0
2016-12-14 18:28:01 +02:00
Pasi Kallinen
86df94b281 Impossible instead of segfault in cursed
While fuzz testing, I've seen segfault a handful of times in here,
coming from do_takeoff(). Looks like context.takeoff.what is stale,
having WORN_BLINDF, but we're not wearing the blindfold anymore.

Haven't been able to trace it down yet, so guard it with impossible.
2016-12-12 17:42:06 +02:00
PatR
2655910a0f fix #H4597 - sitting on level teleport trap
During #sit:  "You sit down.  You step on a level teleporter."
Switch to alternate phrasing for #sit.

Webs and polymorph traps had similar issues.
2016-12-08 17:22:59 -08:00
PatR
9b725218bb fix #H4706 - non-zero hit points for poison death
For "the poison was deadly" against hero, hit points were set to -1
(which gets displayed as 0 when shown) but the status lines weren't
being updated, so stale positive HP value was visible during final
disclosure.
2016-12-08 16:39:55 -08:00
PatR
66a0c98954 fix some recent lint 2016-12-08 16:01:09 -08:00
Pasi Kallinen
97ffc0f53d Fix segfault when attacked while polyed into disenchanter
The pointer keeping tabs of monster's current weapon was
not cleared.

How to trigger: Get hit by a monster wielding a weapon,
teleport to another level, poly into disenchanter, get hit
by any monster with AD_PHYS attack and not wielding any weapon.
2016-12-07 20:23:17 +02:00
Pasi Kallinen
b8d8556eff Fix some issues found with fuzz testing
Mostly to do with relocating monsters when the level is already full,
and unsticking a monster if it gets relocated.
2016-12-07 17:53:08 +02:00
Pasi Kallinen
5da34b7db6 Fix segfault when looking at detected monster hiding under unknown armor
This segfault happened when a detected monster such as a garter snake was
hiding under an unknown/unseen armor of a type that has no description
field (eg. a leather armor), and you farlooked at the monster.

At the same time, simplifies the code a tiny bit.
2016-12-02 22:12:44 +02:00
Alex Smith
52457be911 Merge branch 'ais523-movespeed' into NetHack-3.6.0 2016-12-02 17:10:37 +00:00
Pasi Kallinen
b0c68714ce Make Ogresmasher grant 25 constitution 2016-11-14 20:22:33 +02:00
Pasi Kallinen
84dc214e5c Fix wrong material for novels
HI_PAPER is color, PAPER is material - the novel object definition
was using the wrong one. The caused the novel material to be gold.
2016-11-13 15:25:43 +02:00
Alex Smith
11625c0772 Make free actions easier to predict, nonfree actions more predictable
This fixes melee kiting more comprehensively (it now doesn't work
against slower monsters either), and prevents you doing things like
opening up a gap when running from an imp (you couldn't do that in
3.4.3).
2016-11-12 01:24:03 +00:00
Pasi Kallinen
897916f921 Sanity check for returning Mjollnir animation 2016-11-11 18:18:55 +02:00
Pasi Kallinen
f4acfd7995 Make older corpses not taste okay
Post-3.6.0 change made practically all corpses taste okay.
Change it so there's always a 10% chance for the corpse
to taste terrible, and increase the chance if the corpse
is slightly old.
2016-10-27 21:44:44 +03:00
Alex Smith
f715224b9c Merge branch 'ais523-elbereth' into NetHack-3.6.0 2016-10-21 23:30:09 +01:00
Pasi Kallinen
bf1c81c0b4 Accept custom level annotations at the level teleport prompt
via UnNetHack, original implementation by aaxelb
2016-10-18 23:19:16 +03:00
Pasi Kallinen
1506572ea0 With fragile wands, use snap instead of break 2016-10-18 19:42:20 +03:00
Pasi Kallinen
f106b578a2 Wielding Demonbane prevents demons summoning friends 2016-10-18 18:07:53 +03:00