If either rumors.tru or rumors.fal was empty when makedefs made
'rumors', init_rumors() will set true_rumor_size to -1 to indicate
that rumors aren't available. It also closes the input file, and
then #wizrumorcheck closed that again, triggering a crash in the
dlb code.
Fortune cookies and oracles work ok (just not very interesting)
when rumors aren't available. Only the check command had trouble
with that.
The traceback points directly to the problem: divide by 0 happens
if the 'bogusmon' file only contains the "do not edit" line, which
would happen if 'bogusmon.txt' is empty. makedefs probably ought to
complain about that.
There is now one hardcoded bogus monster to fall back to: 'bogon'.
Random tombstone epitaphs report divide by 0 if their text source is
empty, but it is done by rn2() rather than rn2_for_display_rng() so
is just a warning for pre-release code. It would crash for release
version though.
I tried placing an empty engravings file and expected similar results
but didn't see any response. Not sure what that means.
After the fix, empty epitaph file yields blank result so graves that
want a random epitaph won't have any epitaph.
Fixes#302
While polymorphed and underwater, an eel bite killed the hero who
rehumaized and crawled out of the water, then the eel continued with
its second attack and "wrapped itself around you" even though no
longer adjacent. That's a long reach....
| ...@.
| .;}..
| .}}..
Make any additional attacks silently miss if hero changes location
during the attack sequence of a monster who has pinpointed the hero.
If 'sinking-into-lava' is disabled as a displayed status condition
but general 'trapped' is enabled, then display 'trapped' when in lava.
Similarly, if 'grabbed-by-eel' is disabled but more general 'held' is
enabled, display 'held' when grabbed.
Try to make the tracebacks generated via PANICTRACE's libc method
be more readable. There tends to be a lot of blank space in the
middle of lines, depending on the length of the program's or
libraries' file names, which can make lines wrap and the whole
thing sometimes be harder to make out. Narrow it by squeezing out
some spaces from each line before writing to reduce the chance of
line wrapping. That isn't guaranteed to make things ledgible but
seems to help quite a bit. Also, force the line number inserted
by nethack to be two digits so when spanning from line 9 to line 10
it doesn't cause the field positions to shift by a column. (Using
'#panic' doesn't have enough stack frames to illustrate that.)
I think the original libc formatting was designed for the address
column to hold a 32-bit value ('0x' prefix and 8 hex digits), and
eventually extending that to handle 64 bits ('0x' prefix and 16 hex
digits) made things wider than intended. But the gradual increase
in the length of function names we use is also a factor.
The old parseoptions() would get a FALSE return from parse_role_opts() and
then exit FALSE.
The new parseoptions() was printing an error message due to the FALSE return
value, and then exiting FALSE.
Have it behave the original way following parse_role_opts().
Role selection is insanely complex. I had to use a debugger to force
the relevant routine to be executed.
The analysis was correct: it could use rn2(14) to pick a role (valid
values 0 through 12) and randomly getting 13 would lead to a crash.
The terminating element of roles[] passes all the ok_role(), ok_race(),
etc tests. Explicitly exclude that element when collecting the roles
to choose from.
Implement the request that a wielded+thrown aklys be given the same
inventory letter when it returns and is caught and rewielded, even for
the !fixinv setting where inventory letters don't stick. Works for
Valkyrie-thrown Mjollnir and returning (ie, didn't hit) boomerangs as
well as for aklys.
I'm not sure how useful this really is, because on the rare occasions
that it either doesn't return or fails to be caught, it won't be given
the same letter when subsequently picked up. So the player who relies
on it will still be vulnerable to using the wrong letter next time a
throw is attempted. But at least picking it up explicitly displays
the new inventory letter, unlike catching it upon return.
Change a couple of messages. When speed/haste-self times out:
"you feel yourself slowing down" -> "you feel yourself slow down"
because the former was too close to the turn-to-stone countdown and
the loss of speed is immediate rather than gradual.
The vomiting countdown causes confusion and stun; vary the messages
for those if already confused or stunned:
"you feel slightly confused" -> "you feel slightly more confused";
"you can't seem to think straight" -> "you can't think straight".
Separate out the reformatting from other changes I'm working on
for X11 "fancy status". Splits a few wide lines but mostly just
switches to the X11 idiom of combining
XSetArg(arglist[argcount], ...);
argcount++;
onto one line:
XSetArg(arglist[argcount], ...); argcount++;