Commit Graph

346 Commits

Author SHA1 Message Date
arromdee
2cf8261159 Minor cockatrice fix
PS: Why do we have duplicate fixes__._ files in the branches, since by
definition the same file would have to stay the same in any branch?
2011-12-18 05:16:36 +00:00
nethack.rankin
3337f05af8 shop feedback ("gold piecess") (trunk only)
From a bug report, dropping and selling a container that had some things owned
by the hero and some already owned by the shop, you could get "You sold
some items inside <a container> for N gold piecess."  Shop handing for
containers has been changed significantly since 3.4.3, but the typo
"pieces" that then optionally gets plural "s" appended was still there.

     While testing the trivial fix, I noticed suboptional feedback in the
prompt about selling.  For a container owned by the shop, it said "items"
even when there was just one hero owned item inside.  Fortunately this
potentinal can of worns only seemed to have one tiny weeny worm in it....

     The revised version of count_buc() that I've had laying around for
a while is also included.

     The fixes entry is for "piecess", not escaped/captured/exterminated
worms, and goes into fixes34.4 despite this patch being labeled "trunk
only".  Separate patch for trunk to follow.
2011-10-27 02:24:54 +00:00
nethack.rankin
171721adda fix W343-7 - strange topten output on Windows
Using the two Windows binaries, starting a game with the tty
interface (nethack.exe) and saving, then restoring and finishing with
the win32 interface (nethackW.exe) would display the topten output as a
series of popup windows displaying one line at a time.  The win32 binary
forces the toptenwin option to 1, but when restoring a saved game that
would get overridden by data from the save file and could end up 0.

     This change keeps the toptenwin option out of save files, like color
and other display-oriented features that might not be applicable when
restoring on something with different capabilities.  Separate binaries
for alternate interfaces aren't quite the same situation, but close enough.
The toptenwin option can still be toggled interactively with 'O', but the
new value will disappear if you save rather than finish.  Setting it once
via config file or environment variable is the preferred way to go if you
want to override the default behavior.

     Both trunk and branch get iflags.toptenwin added.  For the trunk,
flags.toptenwin is simply deleted and patchlevel.h's EDITLEVEL is bumped.
For the branch, flags.toptenwin is renamed and becomes unused, while
EDITLEVEL is left alone.  Leaving a dummy field in the old toptenwin slot
of struct flags preserves save file compatability with 3.4.3.
2011-09-19 03:08:39 +00:00
nethack.rankin
8dfb62a9d6 jabberwock hands
Revert a change from five weeks ago which added M1_NOHANDS to the
jabberwock definition.  The jabberwock illustration from Lewis Carroll's
_Through_the_Looking_Glass_ depicts one with its forelegs held like arms
and the forefeet look like clutching hands.  Enormous hands, but
nethack's one-size-fits-all object model means they can manipulate things
just like anybody else's hands.
2011-09-02 21:44:09 +00:00
nethack.rankin
c7a867ec78 probably fix teleport display bug (trunk only)
This might fix the following buglist entry
|Teleporting while using tiles may place you one tile beyond the edge of
|the display screen, and place the crosshair on empty space.

     Various bits of code, including teleport, are assigning directly to
u.ux,u.uy instead of calling u_on_newpos().  It wouldn't be an issue for
small tiles where the whole map fits on the screen, but it probably is for
bigger ones where clipping is in operation.  Using u_on_newpos() adjusts
the clipped map right away but changing u.ux,u.uy directly won't do so
until control returns to moveloop() and it eventually calls cliparound().
Usually the hero's position only changes by one column and/or row, hence
stays within the clipping margin, but that's not the case for teleport
nor for hurtling (throwing recoil while levitating, &c).

     Perhaps all the places that assign u.ux,uy should call u_on_newpos()
instead?  Most--all?--of them aren't updating u.usteed->mx,my, but I
guess that monster's coordinates don't matter since it isn't placed on
the map.
2011-08-29 01:36:48 +00:00
nethack.rankin
50e12a87aa fix exploitable security bug in options processing
From a bug report, the function escapes(),
which is used during options parsing for various options that accept
string values, is given user-controlled input that could end with a
backslash or caret (or two character "\M").  Such a malformed escape
sequence would make it consume the input's end-of-string character and
then keep processing whatever followed.  That meant that it could
generate more data than its output buffer was prepared to hold, making
nethack be vulnerable to stack overflow issues.

     His example that was supposed to clobber the stack didn't trigger
any trouble for me, and I didn't bother trying the second one that can
allegedly cause the Win32 binary to run another program.  But the bug
itself is clearly real.
2011-08-03 12:42:12 +00:00
nethack.rankin
164f498a41 mark jabberwocks as M1_NOHANDS
Jabberwocks are flagged as animals hence won't use items, or else
this would have been obvious long ago.  They weren't flagged as no-hands,
so a hero in their form could wear gloves and/or wield a weapon (or a
cockatrice corpse, whose ineffectiveness when used with a claw attack
which followed a bite attack led to the discovery of this oversight).
I'm not sure what a jabberwock ultimately looks like, but am pretty sure
that it shouldn't have usable hands, particularly ones which are only
usable by a poly'd hero and not by jabberwock monsters.
2011-07-26 01:37:53 +00:00
nethack.rankin
edaa9440b7 fix #2382 - temp Dex loss becomes permanent when dismounting
From a bug report, if you dismount
from a steed whose legs are wounded, you won't recover the point of
dexterity which was removed when they becme injured.  He noticed the
case where the steed had just died, but it happens for voluntary
dismount too (actually any dismount except one which wounds the hero's
legs in the process:  DISMOUNT_THROWN or DISMOUNT_FELL).

     It seems rather odd that the hero temporarily loses Dex when the
steed becomes injured, but I haven't changed that.
2011-07-16 03:41:46 +00:00
cohrs
ae1d8af5f3 fix #H2326: support window resize on linux
From a bug report.  Applied the suggested change to enable window resize
support by default on linux.
2011-06-16 15:10:14 +00:00
nethack.rankin
b16fa5084e fix #2276 - unlightable candelabrum
From a bug report, applying unlit Candelabrum
of Invocation when its candles had 1 turn's worth of burning left would
give a message that the candles were burning but not actually light them
if done anywhere other than the invocation location.  Their burn time is
cut it half when not at that spot, and dividing an age of 1 yielded 0,
confusing begin_burn().  They wouldn't light and they couldn't be replaced
since they'd never get used up.

     The problem is real, but the chance of it actually happening in
normal play is just about zero.  This applies his suggested fix of
rounding the halved burn time up instead of down so that it can't yield 0.
It also applies his suggestion that the Candelabrum treat the invocation
spot like any other location once invocation has produced stairs there,
just as the Bell and the Book do.
2011-05-10 02:32:37 +00:00
nethack.rankin
cc03c15978 fix #2142 - skipping levels when climbing with Amulet
From a bug report,
when climbing out of Gehennom while carrying the Amulet, you could skip
a handful of levels by taking the magic portal into the Wizard's Tower,
dropping the Amulet, zapping it with a wand of teleportation--possibly
more than once--until it lands outside the tower.  Then take the portal
back out of the tower and level teleport--feasible now that you're not
carrying the Amulet any more--back to the tower level and retrieve the
Amulet.  Overall probably not much of a savings unless you're having
really bad luck with the mysterious force sending you back whenever you
try to go up.  The hero and monsters can't teleport from inside the tower
to the outside or vice versa; this gives the same limitation to objects.
2011-04-20 23:46:33 +00:00
nethack.rankin
3148c15ee5 fix #2251 - M-5 operation with number_pad:2
From a bug report, using Alt+5 when number_pad mode
is set to MSDOS compatibility (where Alt+5 is supposed to function as the
'G' movement prefix) didn't work correctly.  The code that did M-5 to G
conversion was being executed after the code which should have gotten G's
direction, resulting in strange behavior, probably using stale values for
u.dx and u.dy.  (With current dev code, I evidently had u.dx==0 && u.dy==0
so was getting "You can't get there from here..." which is actually pretty
amusing in the current context.  3.4.3 didn't have that feedback so I'm
not sure what happened in it; possibly just silent refusal to move.)
2011-04-13 01:36:40 +00:00
nethack.rankin
3e44a5fcdc fix #2236 - bag of holding weight
From a bug report, the weight of a non-cursed bag
of holding would be off by 1 when the weight of contents was a multiple
of 2 (for uncursed) or of 4 (for blessed), since the round off handling
added 1 when it shouldn't in those cases.  Mainly noticeable when empty;
the extra 1 unit made it be twice as heavy as it should have been.

     Probably never noticed in actual play.  He has implemented a patch
which shows weights as part of an object's formatted description, making
this stand out.  Supposedly the Vulture's Eye interface also added a
patch like that a farily long time ago; I wonder why nobody using it ever
noticed.  (Maybe the weight was suppressed for bags of holding there?)
2011-04-09 00:30:59 +00:00
nethack.rankin
cc7d1ff9a8 new man/woman (polyself, inevitably...)
Noticed when testing the [trunk] ^X fix:  polymorphing into human
form (not reverting to original form) reported "you feel like a new man"
when I resumed being a cavewomen.  Like with ^X, it used poly'd hero's
current monster gender instead of the about-to-be-restored role gender.
It's amazing that nobody seems to have ever noticed in all this time.
2011-03-01 13:39:59 +00:00
nethack.rankin
5632b4c456 stumble_onto_mimic while blind, #untrap vs mimic
Noticed while testing a forthcoming mimic patch:  when blind, some
actions (open, close, #untrap, applying a key [as of a month ago],
possibly others) taken against a mimic posing as a door would yield
"Wait!  That's a monster!" but leave the map showing the door instead
of replacing it with the unseen monster glyph.  Similarly, using #untrap
towards a known trap location covered by a concealed mimic could yield
"It is in the way." or "It isn't trapped.", depending upon the type of
trap present, and not reveal the mimic.  Same thing happened when not
blind, except the message would refer to "the <size> mimic" rather than
"it".  Now it will expose the mimic, regardless of the type of trap.
2011-02-03 21:10:17 +00:00
nethack.rankin
3e28b6a164 monsters taking possession of shop items
Noticed while looking through steal.c:  theft that takes multiple
turns uses stealarm() callback which removes stolen armor from hero's
shopping bill, but theft that happened without delay did not.  So theft
of an unpaid non-armor or non-worn item while in a shop left it on the
bill where it wouldn't show up for either ``I u'' or ``I x'', hiding the
charge from the player ('$' did disclose the total amount that the shk
was owed though), and the shopkeeper would persist in blocking the door.
This makes immediate theft behave the same as delayed theft; the stolen
item is removed from shop's bill when the thieving monster takes it away
from the hero.

     Dropped items that a shopkeeper doesn't want have their no_charge
bit set; that's only supposed to be used for floor items inside shops.
But no_charge would stick when an object was picked up by a monster, so
the object would stay free for player if that monster was subsequently
killed in another shop which stocked that kind of item.  Probably never
noticed because most monsters won't pick up items off of shop floors,
also most levels don't have other shops dealing with alternate types of
stuff.  This clears no_charge, except when the monster picking up the
item is tame (so that a pet picking up and then dropping a no_change
object in the same shop won't cause the shk to silently take possession,
which would certainly lead to reports of a bug...).
2011-01-16 00:31:28 +00:00
cohrs
9b1f0899b0 fix grid bug travel bug
From a bug report, grid bug could travel 1 step diagonally
due to special case code in findtravelpath that did not check grid bug
movement restriction
2010-12-30 21:47:06 +00:00
cohrs
8047d6a5f8 H2162 - topten handling of long names
<Someone> reported that being killed by a monster with a long name
can result in nethack going into an infinte loop printing spaces.  Handle
this by detecting attempts to wrap the topten output on a word that is too
long and just inserting breaks in the middle of the word in this case.
2010-12-28 19:43:01 +00:00
nethack.rankin
9269642f2a fix #H2060 - objects blanked by water while hero is blind
From a bug report, if you entered water
while blind and any spellbooks got blanked, you would know they became
"plain spellbooks" iff their original description was known.  The same
situation applied to scrolls and potions; if they had been previously
seen you'd learn they'd become blank or clear.  This fix resets the
obj->dknown flag during transformation so that altered objects are only
known by their class when blind, never their description, the same as
when they hadn't been seen before being blanked.  (When sighted, the
dknown flag gets set again the next time the object's name is formatted,
so the player shouldn't be able to notice that any reset took place.)

     Unpaid objects which get blanked should be treated as used up for
shop billing purposes (force the hero to buy), but there aren't any pools
in shops so aside from the added comment I'm going to pretend I didn't
notice that that isn't being done....

     Potions seen before becoming blind which become diluted while blind
will be known to be diluted since there's no way to know the description
without also knowing the dilution.  I don't think that's important enough
to track known-dilution separately, although I suppose we could overload
the cknown (contents-known) flag for that if necessary.

     This also removes an inaccurate comment about the effects of Luck.
Its maximum is always 13 regardless of whether the moon is full, so 5%
for the lowest chance of blanking via submersion was impossible.
2009-12-15 02:38:50 +00:00
nethack.rankin
403dd4ef95 fix #H2059 - writing spellbooks while blind
From a bug report, you could write a
spellbook with a magic marker while blind and were told the description
(often a color) of the resulting book.  This prevents books from being
written while blind, just as they can't be read in that situation, and
it adds an extra test when attempting to write scrolls while blind.
(When you succeed in writing a scroll while blind, you're just told that
the result is ``x - a scroll'' as it's moved to its new inventory slot.)

     This also removes a couple of overly hyper exclamations when writing
fails.  Someday somebody ought to go through the whole program and decide
which messages actually warrant exclamation points, but I doubt that
that'll ever happen.
2009-12-14 23:46:30 +00:00
nethack.rankin
d69f078b7e pickup_burden typo/thinko
From the newsgroup:  the 'O' command's menu for setting pickup_burden
shows "Unencumbered" for the 'u' choice but the Guidebook and the in-game
options help show "Unburdened".  (For config file processing, the program
only examines the first letter so accepts either value.)  This changes the
documentation to match the game.
2009-10-18 23:52:39 +00:00
nethack.allison
1ab6a4d9d7 Add list of fixes from <Someone> to doc/fixes34.4 2009-10-10 17:34:42 +00:00
nethack.rankin
1ad1e07d7a fix #H2010 - quaffing wielded potion of polymorph
From a bug report, drinking a potion of
polymorph which is wielded would trigger an "object lost" panic if hero
took on a form that was forced to drop its weapon.  Once weapon/potion
got dropped, subsequent useup() of the potion was no longer operating on
an inventory object.

     Unwield the potion at start of drinking, so that dropping doesn't
come into play.  (If we ever introduce a monster form incapable of
holding inventory so drops everything, this will have to be revisited.)
2009-08-22 01:14:48 +00:00
nethack.rankin
e450ca626d fix #H1996 - digging message for missing boulder
From a bug report, it was possible to get
|You hit the  with all your might.  You stop digging.
if a boulder went away--in his case, it was picked up by a giant--while
you were occupied trying to break it with a pick-axe.  The code explicitly
used "" to fill in the message when dig_target had an unexpected value.

     This just avoids giving the message in a case like this.  Possibly
extra stop_occupation() calls should be done instead, but I didn't want
to try to figure out how many would be needed (monster picks up object,
monster zaps wand of striking, others?).
2009-08-22 00:02:09 +00:00
nethack.rankin
ad1dec0745 poly'd hero mimic hiding vs polymorph
From a bug report, if you were a mimic
who was hiding (via #monster, becoming a strange object) and polymorphed
into some other monster type, you retained the hidden/object form.  That
didn't happen when reverting to normal form, or when polymorphing into a
monster while involuntarily mimicking gold, but handling for the latter
inadvertently blocked dealing with the hiding-voluntarily case.
2009-06-13 02:10:21 +00:00
nethack.rankin
077606bc01 fix #H1826 - split long worm with 0 hit points
From a bug report, a long worm with 0 HP
was observed via stethoscope after cutting one or more worms in half many
times, followed by an unspecified crash.  Cutting a worm doesn't reduce
its level below 3, but if a worm is drained to level 0 by some other means
and then gets cut in half (and still has at least 2 HP left), cutworm()
would give the new level 0 worm 0d8 (hence 0) for current and max HP.
That could confuse end-of-move monster cleanup, which thinks 0 HP is a
dead monster who has been removed from the map but not yet purged from the
fmon list.  Purging it would then leave a stale monster pointer on the map.

     cutworm() should have special cased level 0 to use 1d4 for HP, but
instead I've changed it to not produce a cloned worm if the source one is
lower than level 3.
2009-03-06 02:22:14 +00:00
nethack.rankin
a2257ebb1a mimics as doors on rogue level
From a bug report.5 years ago? and again today:
mimics appear on the rogue level even though they're lowercase letter
monsters.  <Someone> notes that during level generation, mimics pretending to
be closed doors are sometimes substituted for trapped actual doors.  That
should be avoided on the rogue level both because its doorways are always
empty (enforced after the fact in extralev.c code rather than in the door
making code) and because mimics aren't uppercase letter monsters (so
should only ever appear there if they've travelled from another level).
2009-02-22 01:37:09 +00:00
nethack.rankin
84ca1773e5 fix #H1803 - levitating at floor level...
From a bug report, being stuck in the
floor or in lava and trying to move downwards while levitating gave "you
are floating high above the floor/lava" which contradicts being stuck.
Now you'll get "you are trapped in the floor/lava" in that situation.
I thought about letting it fall through to the chance to autodig with
wielded pick, but decided to go with just the alternate message.  (Being
tethered to a buried iron ball still lets you "float high above the floor",
so this doesn't check for being trapped that way.)
2009-02-01 00:56:50 +00:00
nethack.rankin
624df671c6 lifesaved steed (trunk only)
From the newsgroup:  hero's steed can become untame if killed while
it is wearing an amulet of life saving, leaving the hero still mounted
and resulting in repeated "placing steed onto map?" warnings when the
steed tries to move.  Force the hero to be thrown off the mount in that
situation.
2008-11-24 23:35:33 +00:00
nethack.rankin
1179bb964c monsters putting on shirts
From the newsgroup:  code intended to prevent a monster who's wearing
a suit from putting on a shirt didn't work due to faulty logic.
2008-09-04 20:21:06 +00:00
nethack.allison
60b7b2c0f0 change of fruit name
From a bug report:
The following steps do not yield the expected fruit:
  1) start nethack in explore mode (with a wand of wishing)
  2) change fruit name to "tomato"
  3) save/restore
  4) change fruit name back to "slime mold"
  5) save/restore
  6) wish for a fruit; you get a tomato
  7) check options; fruit name is set to "slime mold"

If you specified a fruit name that already existed in the list,
fruitadd() always set current_fruit to the fruit with
the highest fid encountered in the list to that point, instead
of the fid of the matching entry.
2008-07-19 22:56:37 +00:00
nethack.rankin
d5ca34a45b initial sling skill
From a bug report, archeologists were
inadvertently starting out at basic skill level in sling because of their
carried touchstone, which is flagged as being sling ammo.
2008-05-08 03:50:44 +00:00
nethack.rankin
6e07a2ffe1 display/map glitch in C quest temple
From a bug report:  in the irregularly
shaped temple on the C quest home level (the room where the leader is
located), the lit south wall contained a dark spot where a secret door
is located.  It stayed blank until you got right next to it rather than
just until you got to a good angle facing it.  (Magic mapping hides the
problem by showing that spot as a wall instead of leaving it as unseen;
you have to walk or teleport to that room in order to see the problem.)
The code that lights walls and doors which border lit rooms neglected
temporary walls produced by secret doors.
2008-03-01 08:10:53 +00:00
nethack.rankin
a023e8188f fix #M57 - alchemical potion explosion fails to wake monsters
From a bug report,
the message when dipping one stack of potions into another triggers an
explosion says "BOOM" yet nearby sleeping monsters remained undisturbed.
2008-02-21 06:18:08 +00:00
cohrs
28a6a8df9f H1406: jellyfish have no head
I did some research, and technically, a jellyfish does indeed have no head
(and, technically, no brain, just a "nerve net").  The part on top is a
"bell" used for buoyancy, not a head.
2008-01-25 16:58:48 +00:00
nethack.rankin
645461d750 shop gold vs hangup
From the newsgroup:  hangup save while picking up gold from the
floor in a shop would duplicate that gold in the save file.  First the
gold amount was being added to hero's gold, then two messages were given
[pline() or prinv() about pickup followed by one from costly_gold() about
shop credit], and lastly the floor gold would be removed.  The second
message could trigger --More-- and provide a controllable interruption
point between giving the gold to the hero and removing it from the floor.
Change this to do the removal step before feedback.
2007-11-18 19:52:44 +00:00
nethack.rankin
a675cc6ed7 vms file access
Fix the problem From a bug report.  His system has a logical name "DATA" pointing at some disk, and
when the dlb utility tried to open "data" for inclusion in the library
being built at install time, it attempted to access the wrong thing and
failed.  He then attempted to fix it in a manner which let dlb finish, by
modifying dlb_main.c to append "." to file names that lack a dot, but
then nethack couldn't access "dungeon" in the library because string
comparison didn't match the altered dlb directory entry of "dungeon.".

     NetHack was working around this unintended interaction with the
environment issue in fopen_datafile(), and dlb was doing so for fopen()
but not open().  This moves nethack's fixup out of src/files.c and into
sys/vms/vmsfiles.c, adds another routine there so that both open() and
fopen() are covered, and updates the vms Makefiles so that the various
utility programs all link with vmsfiles.  (The build script vmsbuild.com
puts object files into a library and gets that last bit for free.)
2007-10-28 09:37:56 +00:00
nethack.rankin
bdb0930316 invisibility vs blindness
Reported a month ago by <email deleted>, putting on
a cloak of invisibility while blind and then using ';' or '/' to examine
yourself revealed that you had become invisible.  This fix just changes
the lookat() output when you can't see that you can't see yourself.  :-)
Probing and stethoscope still reveal invisibility, as will any message
which uses x_monnam() to identify the hero.  (First part is intentional;
last part seems not worth bothering about--I'm not even sure that the
player can arrange to trigger it.)
2007-10-26 02:00:43 +00:00
nethack.rankin
01f954a855 fix #H1378 - vault guard interaction while swallowed
From a bug report, if you're swallowed
while in a vault and the guard arrives, he'll ask your name even though
you're hidden within the engulfer.  This makes him give a message and
then leave, as is already done if you're mimicking an object or unable to
speak.

     This also suppresses his repeated "Move along!" message if you're
swallowed or held since it's silly to keep telling you to move when you
obviously can't.
2007-09-01 01:12:34 +00:00
nethack.rankin
86fccb4e1a re-fix #H1371 - dead monster fleeing
From a bug report, a monster which
died by moving into a trap which was next to the hero standing on Elbereth
resulted in "The <mon> is killed!  The <mon> turns to flee!".  An earlier
change made monflee() return if it's given a dead monster, so the fleeing
message is no longer given.  This fixes the place where monflee() was
inappropriately being called for a dead monster in the reported situation.
2007-08-20 00:05:24 +00:00
nethack.rankin
03eb70acab fix segfault from splitting 1hp long worm
Fix the crash From a bug report, where
having the hit that cuts a long worm into two also take the original down
to 1 HP would result in clone_mon() returning null and nethack crashing due
to a segmentation fault or access violation.  The same thing could happen
if there's been enough long worms created to get them flagged as extinct.

     This bug was only present in 3.4.3.  Prior to that, cut_worm() did
its own monster creation inline instead of calling clone_mon(), ignoring
extinction and too-low hit points.
2007-07-28 03:26:45 +00:00
nethack.rankin
557650ac55 seeing a monster make itself invisible
From the newsgroup:  you could get "suddenly you cannot see the <mon>"
even though it remained visible.  Cited case was for an orc who drank a
potion of invisibility while being observed by a hero wielding Sting, which
causes orcs to be displayed even when they're invisible.  But it could also
happen when non-blind telepathy or extended monster detection is in effect.
2007-07-16 06:44:57 +00:00
nethack.rankin
382bbf7f8e drawbridge tuning
Reported recently by <email deleted>:  opening or
closing the castle drawbridge by playing the tune wasn't using up a turn.
2007-07-09 00:53:59 +00:00
nethack.rankin
a7e312aedc Amulet-covetting monsters attack Wizard
Another entry in $cvsroot/shared/bugs/buglist, this one reported by
<email deleted>:  if the Wizard had the Amulet and used
his "double trouble" spell, his clone would attack him in order to try to
get the Amulet.  This prevents any monster who's after the Amulet from
attacking the Wizard to get it.
2007-06-21 02:35:30 +00:00
nethack.rankin
d34e557df5 very old death drop bug
From an entry in $cvsroot/shared/bugs/buglist From a bug report:
when item weights were all scaled up by a factor of 10 for 3.1.0, the
code controlling random item drops by monsters still limited small ones
to dropping things of 3 weight units of less.  Scale that up to 30.
2007-06-21 02:15:26 +00:00
nethack.rankin
47348b92d7 anmesia of last discovery (trunk only)
While testing something, I noticed that my last remaining discovery
would never be forgotten.  The formula
  count = ((count * percent) + 50) / 100
always yields 0 with count==1 and percent==25 (the value used for mind
flayer attacks).  Not likely to come up in actual play very often....
2007-05-22 00:41:12 +00:00
nethack.rankin
2ff8b16874 fix #H333 - boulder theft
From a bug report:  nymphs could steal
boulders even though they aren't allowed to pick those up.  It happened
becuase can_carry() is only called for monkeys (consequently, they don't
have this problem), not for nymphs.
2007-05-19 04:09:01 +00:00
nethack.rankin
78d9a4186a defunct tame engulfer
From the newsgroup:  Conflict caused tame engulfer to swallow hero.
To try to get out, player hit it (with Magicbane, but that's not relevant
other than to provide an alternate "you hit it" message).

  The magic-absorbing blade probes the invisible Audrey!
  You get regurgitated!
  placing defunct monster onto map?
  Program in disorder, &c
  [some look_here() feedback]
  You kill poor invisible Audrey!

The problem was caused by hmon_hitmon():  it subtracted damage from the
target's hit points, did some bookkeeping and message delivery, then
called killed().  One bit of bookkeeping was to call abuse_pet() and
monflee() when the target is tame, regardless of whether the damage was
fatal.  monflee() -> release_hero() -> expels() puts the hero and the
engulfer back onto the map, and that warning was triggered because the
former engulfer had no hit points left.
2007-05-17 06:30:18 +00:00
nethack.rankin
dab873154e fix #H331 - kicking at empty takes no time
From a bug report, getting the "you kick at
empty space" result doesn't use any turns but can have side-effects like
waking up monsters and negatively exercising hero's stats.  It should take
a turn even though nothing gets kicked.
2007-05-17 03:12:32 +00:00
nethack.rankin
b805ba7bc3 splattered oil fix
splatter_burning_oil() is called when a lit potion of oil gets
broken, and it can dish out fatal damage to the hero.  An earlier fix
to prevent a light-source panic (thrown item is not on any of the object
lists) during bones creation didn't address leaving that lit potion
intact if it was on the floor (which can happen if the breakage is caused
by striking or force bolt rather than its being thrown or kicked).  Use
the existing obj->in_use mechanism as a more general fix, after teaching
bones code that it applies to other things besides the hero's inventory.
2007-05-11 02:25:55 +00:00