PatR [Sat, 2 May 2015 09:44:57 +0000 (02:44 -0700)]
more owornmask sanity_check
Fix the problem with erroneously detecting wielded or quivered
chained ball which legitimately has more than one mask bit set.
Add an additional check for valid wornmask of an item somehow worn
in an invalid slot (such as an amulet in one of the ring slots).
Only lightly tested; it really needs debugger assistance to force
various invalid situations but I don't know gdb well enough for that.
PatR [Sat, 2 May 2015 02:44:56 +0000 (19:44 -0700)]
enlightenment for polymorph & lycanthropy
Fine-tune lycanthropy feedback by combining "you are a werecritter"
and "you are in beast form" into one message. Also, add some new
feedback when lycanthropy and intrinsic polymorph are blocked by
intrinsic unchanging.
PatR [Sat, 2 May 2015 01:01:12 +0000 (18:01 -0700)]
stabilize loss of gold
When gold is stolen by a leprechaun or lost when being "overwhelmed
by an urge to take a bath" while dipping in a fountain, if you had
99 gold pieces or less, you'd lose all of it (in the bath case, only
if it was at least 10 to start with), but if you had 100 or more,
you would lose a random amount which could be as little as 1. And
in the bath case, if the random amount was less than 10, you would
lose nothing but be told that "you lost some of your money in the
fountain". After this change, it is still possible to lose less
when starting with more, but not as likely and not as extreme a case
as maybe losing only 1 when starting with thousands.
The fountain-dip bath case has code to handle mutiple denominations
of coins, possibly the only place in the program where that exists.
I've left that alone although it should probably be taken out....
PatR [Fri, 1 May 2015 09:32:14 +0000 (02:32 -0700)]
sanity check owornmask
Extend the processing done by the wizard mode 'sanity_check' option
to look for anomalies with obj->owornmask since there seem to have
been a few lately. I haven't actually triggered any so this code
isn't very well exercized yet.
sanity_check uses pline() rather than impossible() or debugpline()
to deliver messages so might not be very useful with keymasking.
A sizeable chunk of this diff is just cleaning up indentation so
that I could see what I was working with....
Pasi Kallinen [Wed, 29 Apr 2015 13:28:01 +0000 (16:28 +0300)]
Prevent monsters throwing items out of map
If a monster was in the projectile's path, the projectile stopping
checks would not be reached. The thrown object could fly up to
the maximum range, through walls, or even outside the map.
Fix filtering used by the 'D' command, and a few other activities that
allow both object class filtering and bless/curse state filtering, so
that when both class(es) and state(s) are specified, objects need to
match both rather than either. D?C will present the player with cursed
scrolls to drop rather than all scrolls plus all other cursed objects.
This also fixes another instance when gold could end up with its bknown
flag set.
Alex Kompel [Sun, 26 Apr 2015 21:47:38 +0000 (14:47 -0700)]
bubble structure contains pointer into static array. Bubble objects
are being flat-dumped into save file and this causes segfault in restore()
whenever data segment layout changes (e.g. global variables added/removed).
bmask should either be stored with the objects.
Allow the 'I' command to show inventory of known blessed items via
pseudo object classes B, C, U, and X. That's instead of an showing
inventory of specific object class. The two can't be combined
because 'I' operates on single character input.
I had to modify tty_yn_function to prevent it from forcing a BUCX
character into lower case (simply using lower case would cause a
conflict with 'u' and 'x' for inventory of shopping bill), and did
that by checking whether any of the acceptable response characters
are upper case. Pretty straightforward and shouldn't impact any
other uses that don't specify upper case choices.
I did the same thing for X11. Other interfaces most likely need
to do something similar. If they don't, a response of 'B' or 'C'
(for menustyle:traditional or menustyle:combination) will simply
not work, without causing any problems, same as typing an invalid
choice, and 'U' or 'X' will give shop feedback instead of the
requested subset of inventory.
Pasi Kallinen [Sat, 25 Apr 2015 12:19:13 +0000 (15:19 +0300)]
Show only the short automatic glyph description
When you turn on the automatic description of a glyph under cursor,
we want to show the short description of what glyph it actually is.
The long full description of all possibilities is far too long, so
may cause more-prompts, and is awkward for blind players.
Replace most uses of isspace() with a simple test for ' ' after
processing the string buffer with mungspaces (which replaces tab
with space, converts instances of consecutive whitespace into a
single space, and removes leading and trailing spaces). The uses
where this wasn't done now cast their argument to (uchar) so that
platforms with signed chars will never pass negative values to it.
I didn't mess with the menu coloring code (except for casts to the
isspace() argument); it almost certainly could benefit from using
mungspaces. I did mess with the symset processing quite a bit,
and hope I haven't accidentally broken anything. Default symbols
and DECgraphics symbols still parse and display ok, so the rest of
dat/symbols should be ok too. I didn't test symbols in the user's
config file because I don't remember how that's supposed to work.
Avoid initializer for auto-class array since many pre-ANSI compilers
didn't support that. Also, when ESC is used to cancel inventory
selection, don't continue on searching for that selection in invent.
Still doesn't address the reported stack corruption.
* 'alt' points to a buffer which has already been processed by
lcase(), so remove the redundant call to that routine;
* common error exit accessed via 'goto' could potentially leave
a dangling window structure (only if 'data' is corrupted though;
it's the only way a failure at that late point could occur).
I didn't find Michael's crasher, but I did find a couple of minor
problems:
knight's saddled pony wasn't found in the file lookup either though
there is an entry for pony ("tame saddled <foo>" stripped off "tame "
but not "saddled "; "saddled <foo>" would only be found of there was
a wildcard entry key of "*<foo>", like "*horse" to catch both horse
and warhorse);
"wombat" matched the bat entry rather than reporting an unknown
entity.
Remove the code that converted statues shown as monsters into stautes
shown as big rocks when saving and then reversed the effect when
restoring. It was done to preserve save file compatability with 3.4.3
where statue-as-monster glyphs didn't exist, so is no longer useful.
* remove several unreachable panic() calls; alloc() already panics
rather than return a null pointer;
* replace a couple of calls to malloc() with alloc() so that
MONITOR_HEAP won't produce spurious alloc/free discrepancies;
* replace several instances of variable 'd' with 'd0' so that it
doesn't conflict with the name of a function;
* comment out opvar_new_region() since it isn't used anywhere.
Derek S. Ray [Wed, 22 Apr 2015 01:47:33 +0000 (21:47 -0400)]
Make coalescence message be smart about status
- honor blindness and hallucination
- honor ability to see one of the mergees
- provide audible feedback if appropriate
- merging inside pack gets special-cased so player knows something
different/unusual is happening
mongone() would send away a vault guard, whether alive or already
dead and parked at <0,0>, losing the information needed to remove
the temporary vault corridor once whatever obstacle (ie, the hero)
that's keeping it in place has been cleared. Have mongone() call
grddead() like mondead() does, so that a guard will just be moved
to <0,0> with 0 HP and kept there rather than being purged during
the next dead monster removal.
Move polearm context reset to m_detach() [and, unfortunately,
duplicated in grddead()] rather than in having it in dmonsfree()
since execution of the latter is deferred. I'm not sure offhand
whether a fast hero could get a second move before end-of-turn
purging of dead monsters.
Give 20 experience points the first time the hero reads a passage
from a tribute novel. It's enough to go from level 1 to 2 or from
2 to 3. By the time a book store is found, that's too trivial for
most to care about, but it's potentially useful to a pacifist.
extend the tty statue patch to tiles
Changes to be committed:
modified: doc/fixes35.0
modified: win/share/gifread.c
modified: win/share/monsters.txt
modified: win/share/objects.txt
modified: win/share/other.txt
modified: win/share/tile2bmp.c
modified: win/share/tilemap.c
The tty code already had the statue patch included, where
statues are represented by stone versions similar in
appearance to their monster likeness.
This extends it to tiles.
A new pass through the monsters.txt file is done
in tile2bmp to include new modified tiles to the output
file that are gray-scaled versions for mapping to the
NetHack statue glyphs.
When minimal_xname() set up a dummy object containing as few details
as possible, it wasn't setting up the fruit id field, so xname()
couldn't figure out what type of fruit it had and issued a warning.
I haven't managed a test case that uses minimal_xname so testing of
the fix is less than comprehensive. [Pasi got it through dopay, but
that only resorts to minimal_xname if the formatted name is really
long and would otherwise cause the shopkeeper's prompt to overflow.
Long fruit name combined with long individual object name wasn't
long enough to trigger that. Maybe uncursed, greased, rustproof
the like, or possibly just a longer shopkeeper name than I had?]
The previous fix prevents the crash from 'the()' when NO_GLYPH was
used as an index into the defsyms array, but it resulted in giving
feedback of "you attack thin air" regardless of what was at the
target location, reverting to the situation that the buggy code was
attempting to address in the first place. Handle that differently
by removing the unseen monster glyph sooner. Also, the underwater
handling wasn't working as intended.
I blamed Derek's pudding farming patch for introducing the problem,
but all that did was replace the offending line(s) with different
indentation. The older post-3.4.3 patch which produced the problem
was mine. Sorry, Derek.