Fix several warnings. Accept ASCII RUBOUT (aka DELETE) in addition
to backspace. [Should use erase_char (and add support for kill_char)
but that means pushing get_count() into the interface code.] Guard
against user causing the count to wrap if someone ever adds a call to
get_count() which doesn't specifying a maximum value.
The number of passages felt a little light, so split one of the
long-ish ones into two. The punchline that now ends the first one was
being watered down by continuing the text, and an interesting bit that
was left out can be added to finish the second part. They both lose
some context but I think they work ok separately.
'... inconsistency in character creation menus'.
During role selection, the final 'is this ok?' menu has 'yes'
preselected so accepted <return> or <enter> to answer yes. The
pick-role, pick-race, &c menus prior to getting to that stage didn't
have a default, so using <enter> meant nothing was chosen, and choosing
nothing was treated as a request to quit. This changes that so it's a
request for 'random' instead.
'Provisional fix' because it ought to do this by making 'random' be a
pre-selected menu entry so that the default choice is visible. But
that takes more effort than I'm inclined to expend on this.
Fixing a couple of warnings led to discovery of a couple of real bugs.
Warnings:
1) -Wshadow warning for 'dist2' variable blocking access to dist2()
function.
2) Declaration not at top of block not allowed for C89/C90 (let alone
for pre-ANSI).
Bugs:
3) there might be 0 visible monsters, in which case the code prior to
qsort will call alloc(0). I think ANSI requires malloc(0) to return
a unique pointer which can be freed, but pre-ANSI malloc might
return Null to satisfy it, leading to panic from nethack's alloc().
4) visible monsters in direct line with hero horizontally or vertically
were unintentionally skipped when collecting monster locations.
I think looking at monsters is the wrong way to implement this. It
should be scanning the map for monster glyphs instead. (Coin toss as
to whether it should also treat statues-shown-as-monsters as if they
were monsters while doing this. I'm leaning towards yes. And what
about warning glyphs and instances of the remembered-invisible monster
glyph? They aren't interesting to look at but they might provide a
shortcut to positioning the cursor near something else.)
Using '^' to move to next trap moves from hero's position to end of
hero's line, then columns 1 to N of next line, and so on to bottom
right, then top left columns 1 to N, second line 1 to N, on down to
hero's line. Having 'm' traverse monsters from nearest to farthest
feels like a noticeable inconsistency between the two. Especially if
you move the cursor with direction or topology keystrokes prior to 'm'.
This happens when levelporting to the first Sokoban level in wizard mode
before visiting the level, causing the branch stairs to not appear until
the space it is in comes in sight of the player.
The issue was that levels flagged premapped would cause the special
level coder to call sokoban_detect() before fixup_special() had a chance
to place the branch stairs properly.
Fix from Dynahack by Tung Nguyen.
'Poisoned by a rotted gray ooze corpse' should have been
'Poisoned by a rotted glob of gray ooze'.
eatcorpse() is called for non-corpse globs and then corpse_xname()
is called for them too to set up death reason for make_sick(), but
it didn't know anything about globs. Now it does. Blob size is
ignored since it's not relevant for cause of death.
Stepping onto lava destroyed water walking boots if they weren't
fireproof but didn't do that for other types of boots unless hero
was not fire resistant and got killed by the lava. Burn up all
non-fireproof leather boots when stepping onto lava.
Also #terrain command with dark_room on showed lit room floor on places with
objects or traps. We don't want to show dark room symbol anyway, because
the dark room symbols are only for line-of-sight, and #terrain should
override that...
ck_server_admin_msg() is only available for '#if (UNIX && MAIL)' but
moveloop() tried to call it unconditionally. Call if from the UNIX
edition of ckmailstatus() instead.
It's occasionally important for public servers to notify
all the players. Sending a mail is not reliable, as not everyone
wants to break conduct, or have mail on.
This adds a compile-time defined filename, which NetHack
will monitor. The contents of the file are in the same
format as SIMPLE_MAIL: "sender:message" on one line.
Fix the vault guard error in dochug() discovered by Alex K. The
behavior of a vault guard ignoring Conflict when confronting the
hero in the vault and escorting him through the temporary corridor
isn't affected. 3.4.3 already behaved that way. (I didn't track
the cause of that down so don't know whether it's intentional.)
Steps to make sure 'kickedobj' didn't end up as a stale pointer
prevented it from being around to format the reason for death when
a kicking attempt was fatal.