Commit Graph

5782 Commits

Author SHA1 Message Date
PatR
2e9a2002c4 NH_HEAPLOG vs tile utilities
I just tried to build with MONITOR_HEAP defined in unixconf.h plus
WANT_WIN_X11=1 for make.  tile2x11 wouldn't link.  It doesn't use
alloc() and free(), but it does link with drawing.o, and drawing.o
has calls to free(), so MONITOR_HEAP makes it need nhfree() from
alloc.o.

All the miscellaneous tile utilities seem to link with drawing.o, so
they all need alloc.o too, and that drags in util/panic.o as well.
I've only changed it for Unix where I can actually test the change
but other platforms probably should do this too.  Or we need to redo
drawing.c so that the small subset of stuff utilities want is
separate from the code the core uses for that same stuff.
2016-02-01 17:30:09 -08:00
PatR
1c9f538424 formatting bit for alloc.c 2016-02-01 17:28:52 -08:00
Pasi Kallinen
89809bf71e Very tiny typofix 2016-02-01 13:43:43 +02:00
PatR
54325de339 fix bz16 - book becoming cursed while being read
Attempting to read a cursed spellbook fails with a nasty effect.  But
a non-cursed book can become cursed while being read (malignant aura
after Wizard has been killed).  Assuming no interruption for other
reasons, the read would finish, the spell be learned, and then the
nasty effect would be given.  This changes things so that if the book
being read becomes cursed and the hero notices (book's bknown flag is
set), the read-in-progress will be interrupted.  Resuming will take
the attempting-to-read-a-cursed-book path.  Unfortunately, if the
hero doesn't notice, the old behavior still applies.  Maybe the new
behavior should happen even if bknown isn't set (but then player
won't be told why the interruption occurred).
2016-01-31 18:22:31 -08:00
nhmall
5774804524 typo bit nttty.c 2016-01-31 18:16:13 -05:00
nhmall
37b79d68cd some updates to nttty.c
Changes to be committed:
	modified:   sys/winnt/nttty.c

better attribute support
more functional inverse support
2016-01-31 18:08:03 -05:00
PatR
757c51bb3c X11 menus - support pre-selected menu entries
X11 had been ignoring add_menu(..., MENU_SELECTED) to specify a
pre-selected menu entry.  This adds support for that.

Attempt to implement pre-selected entry for PICK_ONE menu sanely by
returning the pre-selected entry instead of toggling it off if the
user chooses it explicitly.   Inner workings of menus are convoluted
so I'm not sure it's 100% correct, although testing hasn't found any
problems.  (tty currently returns 0 for "nothing picked" when
explicitly picking a pre-selected entry in a PICK_ONE menu, and the
core jumps through hoops to handle it.  That can't be cleaned up until
all interfaces which support pre-selected entries achieve sanity.)

Make "random" be chosen for <return> or <enter> during role selection
and highlight it to reflect that.  (Role selection for X11 uses its
own code instead of nethack menus, so pre-selection isn't applicable.)
2016-01-30 19:39:29 -08:00
PatR
df41e8f203 tribute: Guards! Guards! 2016-01-30 01:37:17 -08:00
PatR
68b7693d98 crash fix
After the recent shopkeeper fix, I wanted to find out what happens if
you turn to stone in the spot inside the shop door.  It didn't go too
well--a change of mine from three weeks ago caused a crash due to
passing a null pointer to strcmp().  Death from being turned to stone
or from starvation when there was no while-helpless reason (probably
not possible for starving) triggered it.  This fixes that.

As far as the test goes, the shopkeeper takes your inventory and moves
it all the way into the shop, and a statue of the petrified hero is
left without contents in the spot in front of the door.  That shk was
awfully quick....

Post-3.6.0 bug, so no fixes entry.
2016-01-29 17:14:42 -08:00
PatR
31a2b7b5ba fix glob fixes
The impossible about partly eaten glob having more nutrition than
an untouched one after another glob had been absorbed into it was
not a 3.6.0 bug, it was an interim situation when I converted glob
nutrition to be based on glob weight rather than on the creature
corpse weight.  So take that fixes36.1 entry out.

Add one about black puddings that was included in the glob patch.
2016-01-29 16:06:32 -08:00
Pasi Kallinen
d591ebaa46 Fix bz58: Inheritance dispute between shk and risen undead
Prevent shopkeeper from "gratefully inheriting all your possessions"
when your corpse rises as undead.
2016-01-29 16:59:27 +02:00
PatR
b606aea919 more globs... much more globs
Fix a bunch of glob bugs, probably introduce one or two new ones.
2016-01-29 02:07:09 -08:00
David Cohrs
288ac4b07c avoid crash for long lines in nethackrc
read_config_file() has used a buffer of size (4 * BUFSZ) since 3.4.x
so parse_config_line() needs a buffer of the same size to avoid
buffer overrun. Allows my old .nethackrc to work again.
2016-01-28 18:40:59 -08:00
PatR
b632247a74 revisit #H4083 - glob ID and merging
Globs on the floor used different criteria (anything goes) than globs
in inventory (mostly requiring same ownership when in shops and same
curse/bless state--other stuff generally isn't applicable) when
deciding whether two globs should merge.  That was okay as long as
the globs on the floor were from being left behind when a pudding or
ooze was killed, but not if the player had picked some up, dipped
them in holy or unholy water, and dropped them again.  This changes
things so that globs on the floor use the same criteria as globs in
inventory when deciding whether to coallesce.

Also, my earlier fix was modifying globs in the mergeable() test (to
make bknown and rknown match) rather than during actual merge, which
would be a problem if the merger didn't take place for some reason.
2016-01-28 18:13:25 -08:00
Pasi Kallinen
a309e076e0 X11: Attach translations also to menuform
Without this, the keyboard commands don't work in the extended
command window on Linux. If the translations are removed from
menuformview, then the keyboard commands don't work on Mac.

Having the translations in both doesn't seem to hurt.
2016-01-28 19:44:33 +02:00
PatR
09ebe44ae9 fix #4206 - feedback for pet's weapon
The report that a tame Archon got two "<pet>'s long sword is not
affected" messages thought there was some duplication error when a
flaming sphere exploded, which was incorrect.  Since an Archon has
two weapon attacks, getting that message twice just meant that both
attacks hit.  However, the player has only 1/6 chance to suffering
passive fire damage to weapon, where monster-on-monster or monster-
on-polyd-hero was inflicting that for every successful hit, so
there was a bug here after all.  Give monsters the same 1/6 chance.
Also, add even more verbosity to that message--now that it won't be
delivered so often--to mention what didn't affect the item.

While investigating this, I noticed that hitting a steam vortex
with a flammable weapon was doing fire damage to that weapon.  Fire
damage in the steam vortex definition makes some sense in that it
allows fire resistance to give protection, but dishing out actual
fire damage makes no sense and is now prevented for passive counter-
effects.
2016-01-27 17:51:02 -08:00
PatR
90c4898c9a fix 2nd part of #H4188 - monst fleeing up on lvl 1
The code to handle monsters fleeing up the upstairs on level 1 was
expecting those stairs to be normal upstairs but they are actually
sstairs like the ones down into the mines.  So monsters fled to the
Plane of Earth instead of escaping the dungeon as intended.
2016-01-26 19:25:21 -08:00
PatR
9085dc2d7e fix #4189 - burning glob of green slime
When destroy_item() or destroy_mitem() burned up a glob of green slime,
they had the message index and damage amount reversed.  This could give
a nonsense message ("the glob of green slime freezes and shatters") or
go out of array bounds and wreak havoc.  Even if the message index had
been correct, fatal damage would have produced an incorrect cause of
death since it would have used a potion or scroll string.

Now globs will boil and explode like potions, and damage will be
proportional to the size (weight) of the glob, which seems to be the
original intent.
2016-01-26 18:32:17 -08:00
PatR
9d1a3be7d7 revert fix for #H4041 - decl for has_color()
Since the attempted fix for the warning about has_color() being
implicitly declared introduced a worse problem of conflicting
declaration in cases where it's already declared, back that change
out.
2016-01-26 17:39:41 -08:00
PatR
149139a25d prompting for #dip
I noticed that my paniclog had a "Query truncated" entry from testing
the post-3.6.0 changes to #dip prompting.  For
"What do you want to dip <the object> into? [xyz or ?*] "
the use of safe_qbuf() didn't account for getobj() appending the list
of choices, so wasn't ensuring that the formatted object name combined
with the other text couldn't overflow QBUFSZ.

I had a more elaborate fix than this that still used safe_qbuf(), but
the extra complexity just wasn't worth it.  This potentially truncates
the formatted object description more severely than necessary but is
simple enough to be comprehensible.

No fixes36.1 entry.  This is updating a post-3.6.0 revision.
2016-01-26 17:32:05 -08:00
PatR
489445da02 fix part of #H2343 - youmonst.movement vs poly
From a July 2011 report listing multiple movement anomalies, fix one
of the easier ones.  If you polymorph from a fast from into a slow
one, pending movement points can let the slow form get in some moves
it shouldn't.

I've deliberately avoided adjusting pending movement when you change
into a faster form, which will get it's own movement boost on the
next turn.
2016-01-25 18:18:35 -08:00
PatR
5a9e00d0dd mind flayer's damage
From a followup to #H2247, April 2011...  Physical damage from a mind
flayer attack was inflicted in the AD_DRIN case for hitmu(), then
being inflicted again in the common code after the switch statement.
The new comment explaining the reason for non-standard damage is just
a guess.
2016-01-24 16:23:33 -08:00
PatR
49cbcdb137 fix #4191 - flags.verbose vs level change messages
Suppress the "you climb/fly up the stairs/ladder" message if the
'verbose' option is off (unless punishment is going to augment the
message by "with great effort").
2016-01-23 20:16:37 -08:00
PatR
853efee661 fix #H4205 - take-off of covered items
Bug report subject was "menu interface things" but this isn't related
to menus, just getobj().  Make the requested change to not list worn
suit as a likely candidate for T (and R) if a worn cloak is going to
prevent it from being removed.  (Suit can still be picked, but the
take-off operation for it will be refused, same as when it was being
listed as a candidate.)

In discussion about the request, there was a separate suggestion that
cloaks shouldn't interfere with removing things underneath since
they're generally sleeveless.  I haven't done that; I think it is
better to keep the layering as it is.

The bug report also asked for the likely candidates when writing with
a magic marker to exclude non-blank scrolls and books.  That has been
implemented already (post-3.6.0).
2016-01-23 19:38:28 -08:00
PatR
45ba0addf2 another vampire shape-shifting bit
Chameleon impersonating a vampire and vampire subject to protection
from shape changers weren't the only ways to have a vampire monster
which isn't a vampshifter.  One-shot polymorph could produce that too.
2016-01-23 19:15:38 -08:00
PatR
571288ecd3 tribute: Pyramids 2016-01-23 18:37:43 -08:00
PatR
e619e5f66e formatting for 'O' commmand menu
For !menu_tab_sep, the boolean options were formatted with a different
width than the compound and 'other' options when the menu for 'O' was
active.  Use the same format string for all of them, consider them all
when constructing it, and construct it just once instead of every time.
2016-01-23 16:16:36 -08:00
PatR
a21894cc39 tipped ice box corpses
Reported directly to devteam, with patch:  tipping corpses out of an
ice box wasn't restarting their rot timers, producing corpses that
would last indefinitely.
2016-01-23 15:23:45 -08:00
PatR
0ee4611f8f tribute: Wyrd Sisters
I stumbled across why the Death Quotes hadn't been getting displayed
evenly before being recycled:  ones I've added since 3.6.0--probably
even before the release--were unintentionally missing their '%e passage'
directive, so attempted look-up for those returned the very last one
(terminated by '%e title').  The recent change to read_passage() has
made '%e passage' be optional for one-line death quote passages, so
this patch doesn't bother putting them in.
2016-01-23 00:20:15 -08:00
PatR
7e86003367 tty role selection - 'random' default
Instead of just using 'random' as the default choice if the user hits
<return> when picking role, race, gender, or alignment, flag it as
pre-selected in the menu so that it can be seen to be the default.

Someday somebody is going to have to fix up the interaction between
PICK_ONE menu and pre-selected choice....
2016-01-22 18:09:05 -08:00
PatR
0226c904fa X11 menus
Make the six buttons (ok, cancel, all, none, invert, search) on
menus for X11 all have the same width.

'ok' should probably be changed to 'okay' to be consistent with
X11_getlin().  (Another inconsistency:  the extended commands
menu uses 'dismiss' rather than 'cancel'.)
2016-01-21 23:47:42 -08:00
PatR
fca2f74134 X11_getlin() missing winX.h diff 2016-01-21 23:26:00 -08:00
PatR
2bf652dd0f X11_getlin()
Two cosmetic changes for the X11 version of the getlin() routine:
1) Make the text entry box big enough to hold 60 characters before
   sliding the beginning input off the left edge, instead of just 13,
   so that user can see much more of what is being typed;
2) Make the cancel button be a little wider, and the okay button be
   the same width as the cancel button so they look a little nicer.
2016-01-21 23:13:49 -08:00
karnov
93f7df6848 Added anagrams for new team members 2016-01-21 21:38:35 -05:00
PatR
885de116e1 fix #H4204 - shapeshifter taking vampire form
When a chameleon/doppelganger/sandestin took vampire or vampire lord
shape, it stopped taking on new shapes.  Vampire shapeshifting was
being applied to all vampires rather than just to is_vampshifter().
When is_vampshifter() is false, the vampire is some other shapeshifter
or Protection_from_shape_changers is in effect, so vampire shifting
doesn't apply.

While testing, I noticed that vampires/lords only turned into bats/
wolves during initial creation.  They did turn into fog clouds in
order to pass closed doors but the other alternate forms were ignored.
That's fixed too.
2016-01-21 02:12:47 -08:00
PatR
2e2b54e548 overriding message suppression, revisited
This is more robust than the previous hack.  The issue of whether to
use it in other places is still unexplored.  Ultimately it's the user's
fault if overzealous message suppression hides something important.
[For an eerie game, try 'MSGTYPE=hide .'.]
2016-01-19 18:16:13 -08:00
PatR
7482be39e8 lev_comp update for older Unix system
Increase the lex paramaters in lev_comp.l and replace use of snprintf
with sprintf in lev_comp.y and lev_main.c.

Also some reformatting for lev_comp.y, but I gave up pretty quickly:
some early tab replacement and adjusting of the spacing for casts.
2016-01-19 16:27:39 -08:00
PatR
0544b998de fix #H4028 - ':' sometimes doesn't work
User had
MSGTTYPE=norep "You see here"
and complained that once the message had been given while walking
over an object, using ':' to intentionally look at something would
end up doing nothing if its feedback was a repeat of "You see here".

Trying to classify which actions should deliberately override
no-repeat (or no-show) will be an ordeal.  This fixes the case for
the ':' command where the user obviously expects feedback.  I think
it could be done better but am settling for something quick and easy.
2016-01-19 07:13:18 -08:00
PatR
ea35773192 more getpos() help
Explain the what-is response types in the help provided when typing '?'
during getpos operation.
2016-01-19 02:19:33 -08:00
PatR
a968765a4f status conditions in Guidebook
Update the Guidebook to reflect the recently added conditions displayed
on the status lines.
2016-01-19 01:46:13 -08:00
PatR
83a4234292 whatis_coord - rename 'getpos_coord' option
Rename the option for adding coordinates to autodescribe feedback for
the '/' and ';' commands from 'getpos_coord' to 'whatis_coord', after
the '/' command that uses it instead of after the internal routine
that implements it.  The 'whatis' name was only in dat/hh as far as I
could find, so this changes it to 'what-is' and also updates dat/help
and the Guidebook to mention the name too.

Add a 'screen' choice to the option to show coordinates as row,column
rather than x,y or compass direction(s).  Revise the /m, /M, /o, /O
operations of 'what-is' to honor the whatis_coord option (mostly; a
value of 'none' gets overridden by 'map' to force coordinates).

Also, update the description of the functionality of the '/' command
in the Guidebook.  The .mn version is tested, the .tex one isn't.
2016-01-18 19:27:53 -08:00
PatR
8cd65daf39 Death misquotes 2016-01-17 15:05:34 -08:00
Pasi Kallinen
d06450817b X11: autoscroll extended command menu
When you type in the extended command menu to select a command,
scroll the window so that the selected command is always in view.
2016-01-17 13:55:13 +02:00
PatR
350dcf067b tribute streamlining
Chatting with Death doesn't always deliver a tribute Death Quote but
when it does, it wasn't giving each of them once before reusing them
even though they should have been treated the same as passage
selections from a novel.  I'm still not sure why it wasn't working
as intended, but after some revision to the tribute parsing code, now
it is.  If you #chat with Death enough times to get 20 tribute quotes,
you will see each of the 20 quotes once (in random order), then
further chatting will give them again (in different random order).
2016-01-16 17:36:48 -08:00
Pasi Kallinen
06aedee513 X11: Match new extcmd immediately if no match was found
When entering an extended command, allow the user just type
and match a new command immediately, if no match was found,
instead of needing to wait the 2.5 seconds.
2016-01-16 19:05:30 +02:00
nhmall
eee6a87b85 fixes bit 2016-01-16 06:27:05 -05:00
Pasi Kallinen
665bdebcf4 Add fixes entries 2016-01-16 12:20:25 +02:00
PatR
a32b9af88b tribute: Sourcery 2016-01-16 01:59:58 -08:00
Pasi Kallinen
04bc048073 Limit aggravate to inside or outside of the Wizard's tower
There have been several comments on IRC how the Wizard is a very
light sleeper now; aggravate cast by monsters makes him wake up
and come out of the tower.  So, lets limit aggravate to either
outside or inside of the tower, depending on which side the player is.
2016-01-16 09:45:12 +02:00
PatR
cd2f4ac225 another status bit
Accept four digits for spell power rather than hide the amount
exceeding 999.
2016-01-15 21:05:58 -08:00