Commit Graph

4126 Commits

Author SHA1 Message Date
Pasi Kallinen
aac0a21a7e Make graves white
Making them easy to distinguish from walls.
2018-03-15 18:42:25 +02:00
Pasi Kallinen
a785663c58 Attempting to open down or at yourself is same as #loot
Trying to open at the same location as you did nothing,
make it loot instead. Apparently #looting is also annoying
when using vi-keys.

Based on code by aosdict
2018-03-14 20:15:21 +02:00
PatR
c28b44c27c prevent pline() segfault
The use of debugpline() in tty_curs() got me wondering what would
happen if debugpline() was called while pline() is in progress.  I
don't know how to trigger the bad coordinate situation, so I put an
unconditional debugpline() in the NHW_MESSAGE case of tty_putstr()
and used DEBUGFILES=wintty.c to enable it.  Instant segfault, and
the backtrace was short and not useful so the stack might have been
clobbered.  I didn't spend any time trying to figure where or why
the segfault occurred.

Change pline() so that if it is called while the previous pline()
hasn't finished yet (ie, recursively), use raw_print() and return
early.  The raw_print message isn't very useful--it pops up wherever
the cursor happens to be, just like the cursor position bug that has
been an issue recently--but does get delivered without any segualt
and isn't completely useless if DUMPLOG is enabled and you save or
quit before the message buffer gets recycled.  Message readability
situation could be improved but avoiding the segfault was my goal.

Putting any debugpline() into *_raw_print() would be inadvisable....
2018-03-13 11:27:04 -07:00
PatR
152d9e7705 fix #H6955 - wielded potion 'object lost' panic
Report classified this as 'segfault' but it's actually a controlled
panic().  When hero has lycanthropy and is wielding a potion of unholy
water while in human form, if that potion is boiled then it triggers
a transformation to beast form which in turn causes wielded weapon to
be dropped.  When the code unwinds back up through potionbreathe() to
destroy_item(), the boiled potion won't be found in inventory any more
and useup() -> useupall() -> freeinv() -> extract_nobj() panics.
2018-03-11 12:39:01 -07:00
nhmall
6fc324798e H5239 not hypocrisy to speed up your own pet
H5239 1100
2018-03-10 13:17:21 -05:00
nhmall
6586e9204b pluralization special case tweak
mongoose -> mongooses, not mongeese
2018-03-10 11:28:01 -05:00
nhmall
5fece7b175 pluralization bits 2018-03-10 10:43:34 -05:00
PatR
e408c48bb3 mplayer valkyries w/ Mjollnir
If an mplayer Valkyrie on the Astral Plane is given a war hammer,
give her gauntlets of power instead of random gloves since that will
either be Mjollnir or a very wimpy endgame weapon.  (Maybe someday
mplayer Valkyrie's will be able to throw Mjollnir; their chance of
having it on the Astral Plane is moderately high if it hasn't already
been created prior to arriving there.)

I also gave monsters wearing gauntlets of power a 3..6 damage bonus
for hand-to-hand.  While making that change, I noticed that monsters
wielding a scalpel or tsurugi wouldn't split puddings, unlike the
hero (a post-3.6.0 change), so fix that.
2018-03-09 14:11:04 -08:00
PatR
a43b2086e4 stuck_in_wall tweak
When divine aid granted temporary Passes_walls ability to stuck hero,
it was giving 4d4 turns (4..16, avg 10).  But the first warning that
it's timing out is given at 4 turns left so wouldn't be seen if the
random amount of time picked was the minimum.  Switch to 4d4+4 (8..20,
avg 14) so that the message at 4 turns left will always happen.
2018-03-05 12:26:44 -08:00
PatR
8279aa4384 removing a monster from current level
I ended up not using this, but it might as well be included for
potential future use.  Extend mlevel_tele_trap() to support forcing
a monster off the current level to make room either for the hero or
some other monster.  goto_level() does something similar when the
hero is arriving on a level.  This is for situations where the hero
is already there (such as divine aid attempting to fix STUCK_IN_WALL).

mlevel_tele_trap(mon, (struct trap *) 0) will usually move 'mon' off
the level, scheduled to migrate back if the hero leaves the level and
subsequently returns.  'Usually' because it doesn't work in endgame
and certain monsters are excluded regardless of dungeon location, so
caller has to be prepared to try to move another monster (or resort
to goto_level()'s unconditional forced migration).
2018-03-05 12:01:31 -08:00
Pasi Kallinen
b416564f39 Fix garbage value warning 2018-03-05 21:09:15 +02:00
PatR
4328cf49ef fix prayer infinite loop
Reported internally, if a prayer resulted in 'fix all troubles' and
one of those was TROUBLE_STUCK_IN_WALL but safe_teleds() couldn't find
any place to relocate the hero to, nothing was done and STUCK_IN_WALL
would be found again as the next trouble to fix.  Since safe_teleds()
eventually resorts to trying every single spot on the map, there was
no other result possible than failing to find an available spot again,
nothing would be done, and next trouble would be STUCK_IN_WALL, ad
naseum.

I started out with a fix that looked for secret corridors to expose
and doors to open, to make more space available, then try to move a
monster off the level, then try digging out rock and/or walls and
smashing boulders.  None of those guarantee success and I got bogged
down by the digging case.  This was going to be a last resort if all
of those still failed to make somewhere to move the hero, but for now,
at least, I'm skipping all that other stuff and going directly to the
last resort:  give the hero Passes_walls ability for a short time, and
let him or her find own way out of trouble.  The next trouble to fix
won't be STUCK_IN_WALL because Passes_walls makes that a non-issue.

I'm not thrilled with the new messages involved but want to get this
behind me.
2018-03-03 16:46:39 -08:00
PatR
2111abdc29 buried_ball()
Noticed when I was looking at float_up()/float_down() vs being trapped.
(I have a substantial patch for that but it involves infrastructure
changes so will have to go into master instead of the 3.6.0 branch.)
buried_ball() was using nested loops as a very convoluted way to test
  if (otmp->ox >= cc->x - 2 && otmp->ox <= cc->x + 2
   && otmp->oy >= cc->y - 2 && otmp->oy <= cc->y + 2)
I think this revised version is closer to what was intended.

There are issues.  buried_ball() finds the buried iron ball nearest to
the specified location--which is always the hero's current location--
rather than the one which was 'uball' before being buried.  A player
can spot that since iron balls aren't necessarily identical.  Also, it
searches within a radius of two steps but a tethered hero is only
allowed to move one step away from buried ball, so something is off.
2018-03-03 15:26:49 -08:00
PatR
6bd8efe510 aklys tweaks
It turns out that Mjollnir before the recent aklys enhancement and
aklys since then would end up both wielded and quivered if it returned
to thrower's hand while quiver was empty.  Remove it from quiver before
restoring it to hand.

Limit the throwing range of an aklys if it is expected to return (ie,
thrown while wielded as primary) since it is a "thonged club" which is
supposedly attached by a cord to the thrower's wrist or hand.  I have
no idea how long a real cord like that might be.  I set the range limit
to BOLT_LIM/2.  Shorter makes throw-and-return uninteresting for an
item that needs to be wielded to throw--so would probably be swapped
back and forth with a stronger melee weapon or longer range missile
weapon--and longer seems absurd.
2018-03-03 10:54:43 -08:00
PatR
36e4d80547 Cleaver update
I worked on this a while back but didn't commit it because I couldn't
figure out the dead monster which wouldn't die.  Pasi beat me to that.

Clean up the Cleaver code some and make the three-target swing alternate
between counter-clockwise and clockwise to simulate normal right-to-left
swing followed by left-to-right backswing.  (Alternation happens on each
swing regardless of whether it is consecutive with the most recent one.
That's suboptimal but easy....)  Also, stop three-target attack early if
hero is life-saved after being killed by a passive counter-attack from
the first or second target.

Prevent rogue backstab and two-hander breaking foes' weapons when using
Cleaver hand-to-hand because getting more than one of either of those
bonuses at a time would be excessive.  I think allowing those for the
primary target but not for the two adjacent ones would be better, but I
just thought of that and am not going back for another round of revising.

This doesn't incorporate the two pull requests:  one to avoid hitting
tame or peaceful adjacent targets unless the primary was also tame or
peaceful, the other to avoid hitting unseen adjacent targets.  I'm not
sure if that includes remembered-unseen 'I' on the spot or no monster
shown at all.  (There's a third one about updating the map but it isn't
needed for the existing Cleaver code either before or after this patch.)
I'm in favor of the first one and am not sure about the second.  My
original concern was that someone could use Cleaver to find/hit three
unknown monsters at a time via 'F' prefix, but forcefight aimed at
thin air doesn't reach the Cleaver code so that can't happen, nor can
attacking two known close monsters at once by targetting an empty spot
between them.
2018-03-02 18:19:23 -08:00
Pasi Kallinen
a9b6b6a4eb Fix Cleaving giving dmonsfree warning
Due to inverted logic, hitting a blue jelly with the Cleaver could cause
a dmonsfree warning - the jelly would die, but then come back to life
via the passive attack.  This is a post-3.6.0 bug
2018-03-02 15:52:27 +02:00
Pasi Kallinen
ee64ef5482 Fix comment typo 2018-02-28 09:17:06 +02:00
PatR
8acc72b53a Mjollnir bit
Ue the same object name formatting for the new "Mjollnir fails to
return" message as is used for most of the other throwing messages.
2018-02-27 09:28:15 -08:00
PatR
b73d45fd66 throw-and-return for aklys
The comment I added to data.base--to explain that despite what the
short description says, an aklys wouldn't return to sender after being
thrown--was bugging me, so I've made aklyses behave like Mjollnir.
If thrown when wielded as primary weapon, it will usually return and
usually be re-wielded.  I also added a new message when either thrown
Mjollnir or thrown aklys is expected to return and fails to do so.

Most of the diff to dothrow.c is a change in indentation level.  The
amount of code needed was quite small.

Autopickup for thrown Mjollnir which had failed to return was putting
it into the quiver slot if that was empty.  Note quite an outright bug,
but it started wielded and can't be thrown if quivered, so exclude it
from the stuff that will auto-fill the quiver slot when added to invent
(post-3.6.0 issue).
2018-02-26 11:18:29 -08:00
PatR
f3aaee792f fix #H4997 - "Congratulations" -> "Well done"
Reported suggested that "congratulations" was too modern for use by
your god during ascension and that the longer phrases which were
shortened to yield it were too modest for the god to use.  Make the
suggested change.
2018-02-26 08:35:33 -08:00
keni
ef0448dd79 Merge githash 2018-02-26 09:03:12 -05:00
nhmall
c475a5f0c6 Bug 734 - #H4611: Whistling while deaf
fixed
2018-02-25 17:42:31 -05:00
nhmall
9773742e82 fix some msdos build errors 2018-02-24 23:26:25 -05:00
PatR
f44ff54c7f fix #H6861 - whatis behaves weirdly with plurals
Report indicated that looking up "more info?" for "kittens" would show
the data.base entry for "kitten" and then when the display window was
dismissed, another "--More--" prompt for a empty second display window
would occur.  Looking up "2 arrows" from a closely-seen object on the
map behaved similarly.  User correctly diagnosed that the two-pass
lookup left the 'found_in_file' flag set from the first pass during
the second but that just clearing that resulted in "I have no info
about such things" on the second pass.  The code is on the convoluted
side and needed an extra flag to handle 'seen on first pass' in
addition to clearing found flag after the first pass.  I also added a
check to skip the second display if primary and secondary keys don't
match each other but both find the same entry.  To test it, I tried
"a +0 aklys named aclys".  That found the aclys entry but failed to
find "+0 aklys", so I added another change to have the key massaging
remove +/-N after removing "a", "an", or "the".

If "Want to see more info \"" + lookup string + "\"?" was too long,
the prompt buffer passed to yn() was being left uninitialized.  Also,
test for too long was based on BUFSZ but yn() complains (to paniclog)
if the prompt is longer than QBUFSZ.  Make checkfile() construct a
truncated prompt if the lookup string is too long.

I untangled some spaghetti by making all the 'goto's be forward.  It
didn't help a lot but did simplify a few early returns by having them
jump to a common exit instead of replicating the file close.
2018-02-24 19:35:56 -08:00
keni
cf9cf038f3 gitinfo.pl: special case code to allow running it from $TOP or DEVEL without
installing the hooks first
NHgithook.pm: add some warnings if nhversioning can't open files
make sure nhversioning fails before opening gitinfo.txt if it can't get valid
 data
2018-02-23 19:50:15 -05:00
nhmall
65655d2cee Incorporate some git information into NetHack
Incorporate some git information into NetHack so that it
is potentially visible to a player. That's useful when
collecting details about the version that they are
running and, if the gitinfo is present, it can tie the
code to a specific git commit in the repository.

This modifies 'makedefs -v' to check for the presence of a data file
called dat/gitinfo.txt and if it is there, parse out its
contents, then write additional lines to include/date.h beyond
what 'makedefs -v' was previously putting in there, similar to
this sample:

      #define NETHACK_GIT_SHA "0c84e564c78e2024e562d39539376ce2e21eec8e"
      #define NETHACK_GIT_BRANCH "NetHack-3.6.0"

The contents of an appropriate dat/gitinfo.txt are as follows,
and trailing/leading whitespace is not significant:

      githash = 0c84e564c78e2024e562d39539376ce2e21eec8e
      gitbranch = NetHack-3.6.0

It also adjusts the contents of the 'v' version information to
include the additional git info when available.

Also adds some hooks DEVEL/hooksdir and a perl file to DEVEL
for simplifying and automating the deposit of dat/gitinfo.txt
so that it generally reflects the most current git commit.

DEVEL/gitinfo.pl can be used to build dat/gitinfo.txt at any
time without doing a commit, merge, or checkout.
    	perl DEVEL/gitinfo.pl

command line --version and -version support

To complement the extra information being provided in the
version by the 'v' command, this also adds support for the
following new command line arguments:
    --version
     -version            Output the NetHack version string then exit.

    --version:paste      Output the NetHack version string and also copy it to
     -version:paste      the platform's paste buffer for insertion somewhere,
                         then exit.

If the paste variation of -version is requested on a platform that
hasn't incorporated any support for the capability, it will deliver
the version info then an error message, prior to exiting.

To support the extended -version:paste variation, a port needs to:
    - provide a port-specific routine to perform
      the paste buffer copy in a port code file.
    - #define RUNTIME_PASTEBUF_SUPPORT in the include/portconf.h header file.

    --skeleton--
    void port_insert_pastebuf(buf)
    char *buf;
    {
    	/* insert code to copy the version info from buf into
    	   platform's paste buffer in a supported way */
    }

macosx and Windows have both added support for RUNTIME_PASTEBUF_SUPPORT
2018-02-23 19:34:44 -05:00
PatR
5dd6c05322 switch docall() to safe_qbuf()
Simplify docall() for object types.  Adds some different complexity to
a new routine so the overall simplification is rather minimal, but we
already have a routine to construct prompt buffers involving formatted
object names without allowing overflow, so use it.

tty getlin() limits the input to COLNO characters, so 80 by default.
To get potential QBUFSZ overflow, I had to increase COLNO in global.h
and rebuild from scratch.  A value greater than 127 triggers a lot of
warnings.  I didn't try 127.  126 gets one warning, involving use of
FARAWAY (defined as COLNO+2) in dogmove.c.

We should change things to limit object names to much less than 80,
but this doesn't attempt to implement that.
2018-02-23 13:07:49 -08:00
PatR
7a3ff2be54 fix "wonky secret door" in Cav quest
The earlier fix for hoizontal vs vertical doors would have worked for
the Cav quest (lower left in leader's chamber) where door handling
occurs before wallification, but it wasn't working for minend-3 (east
wall of entry room) which already had walls.  The more recent fix
solved the second case but broke the first one.  I think this actually
solves both modes of door classification.  I hope....
2018-02-23 07:25:37 -08:00
PatR
094c7f5c1b fix #6870 - clairvoyance feedback
Forwarded to the contact form from a github "issue":  in some
circumtances clairvoyance lets you move the cursor around to examine
the revealed map, and when doing so starts with "for instructions
type '?'".  When extended clairvoyance periodically kicks in, as
opposed to explicitly casting the spell, there wasn't sufficient
context to figure out what it was prompting for (unless you actually
answer '?' to get instructions).  Depending upon the most recent
message, it could seem like quite a strange prompt.  Explicitly give
a clairvoyance-specific message prior to that.

Also, the getpos() help was including suggestions for targetting
monsters that aren't appropriate when it's being used for detection.

do_name.c has had quite a bit of formatting rot slip in since 3.6.0.
This fixes up the stuff I spotted by manual inspection.
2018-02-21 22:44:15 -08:00
PatR
964120266e pline() -> raw_print() -> dumplog()
Reorder some code in pline() so that early pline messages which use
raw_print() instead of putstr(WIN_MESSAGE) are included in the DUMPLOG
message buffer.  If the game ends soon enough they'll be shown in the
final log; otherwise they'll get pushed out of the buffer once enough
later messages are delivered.
2018-02-20 19:32:47 -08:00
Alex Smith
d4d0f9a69a Merge branch 'NetHack-3.6.0' into NetHack-3.6.0 2018-02-20 21:55:31 +00:00
Alex Smith
5558d62aa8 Wake up monsters, and let them stop eating, before angering them
If we do it the other way round, then mimics will forget what
they're mimicking without a seemimic() call, meaning that the
line-of-sight calculations can get confused if the mimic was
mimicking something opaque.
2018-02-20 21:53:27 +00:00
PatR
859ef823d6 fix #H6867 - mail buffer overrun
Web contact report of a github pull request.  A previous fix from
same user dealt with potential crash caused by freeing mailbox data
when the mailbox came from getenv("MAIL").  getenv() doesn't return
a value obtained by malloc so freeing it was bad.  The fix was to
allocate memory to hold a copy of getenv("MAIL") so that free() was
valid.  Unfortunately it didn't allocate enough space to hold the
terminating '\0' so potentially corrupted malloc/free bookkeeping
data.  And the alloc+copy was being performed every time the mailbox
was checked, resulting in leaked memory from the previous check (if
MAIL came from player's environment).  Fortunately the recheck only
takes place after new mail is actually detected and reported to the
player so the leak was probably small for most folks.

This compiles for the set of conditionals that apply to me (after
taking out -DNOMAIL that the hints put in my Makefile) but I can't
test that it actually works since mail is never delivered to this
machine.
2018-02-19 11:59:14 -08:00
nhmall
0301420fcb fix reported stack corruption bug during Call
Fix an issue reported as github #74.
Some guard code was required to prevent writing past end of qbuf
via a sprintf.
2018-02-19 10:19:44 -05:00
PatR
48af4fa259 static analyzer bit
I can't find the original message at the moment, but one of the things
that an analyzer complained about was the *s='\0' possibly assigning
to a Null pointer.  The superfluous test of 's' in the while condition
has fooled it into thinking that's possible when it's not.

if (s) {
  while (s && ...) {
    *s++ = ...
  }
  *s = '\0';
}
2018-02-17 18:54:52 -08:00
PatR
544b9015ff comment formatting
Fix a few mis-indented comments I stumbled across.
2018-02-17 01:58:14 -08:00
PatR
2c21399a7e place_lregion() bug
Noticed while looking into the TROUBLE_STUCK_IN_WALL prayer bug,
place_lregion() has been using the wrong row for 'low y' in its
whole-level handling, presumeably ever since it was first introduced.
3.4.3 definitely had the same bug; I didn't check any further back.

For maze levels which only consider every other row and every other
column to be viable locations this probably didn't matter.  And even
non-maze levels usually don't have anything on row 0, so this fix
isn't likely to be noticeable.
2018-02-15 10:13:42 -08:00
PatR
b5b513fb44 'Iu' vs unknown container contents
An inventory of unpaid items where more than one was present would
show
|> bag's contents    N zorkmids
if any of the items were inside a container whose contents aren't
known.  But if there was only one item (so container must be owned
by hero) the 'Iu' output menu was skipped for pline and yielded
|> scroll of magic mapping   133 zorkmids
Force the menu display if the lone unpaid item is inside a container
whose contents are unknown.

I'm not sure whether a hero-owned container can have both unknown
contents and an unpaid item in normal play.  I managed it while
trying to fix a reported problem--except I can no longer find the
relevant report--where itemized shop billing also revealed unseen
container contents (for any number of items, not just 1).  That isn't
fixed yet, but I want to get the simpler 'Iu' part out of the way.
2018-02-07 17:31:44 -08:00
PatR
1b8df876c3 some more reformatting, dig.c
A bit more ambitious this time, but not much.
2018-02-06 02:41:31 -08:00
PatR
f4b2b39931 formatting bit for u_on_rndspot()
Something trivial I noticed while looking into the stuck-in-wall
situation.
2018-02-06 02:20:26 -08:00
PatR
e95a709663 fix #H4459 - shopkeeper/scare monster bug
Reported about 18 months ago:  standing on a scroll of scare monster
while next to a shopkeeper who was blocking the shop entrance because
hero was carrying unpaid shop goods would yield "<shk> turns to flee"
but <shk> wouldn't move.  This was a side-effect of making standing
on scrolls of scare monster be stronger than on "Elbereth" when the
latter was nerfed.  Make shopkeepers inside their own shops and temple
priests inside their own temples be immune to the effect of hero
standing on scare monster.

Also, make the Wizard, lawful minions, Angels of any alignment, the
Riders, and shopkeepers and priests in their own special rooms (ie,
all creatures that now ignore standing on scare monster) be immune to
the fright effect of tooled horns.  Innate magic resistance usually
prevented them from being scared anyway, but make it explicit.

Reading a scroll of scare monster or casting the spell of cause fear
still rely on innate resistance to avoid chasing away those monsters.
I'm not sure whether they should have the same adjustment.
2018-02-05 16:36:35 -08:00
PatR
baba2acb8d fix #6691 and a couple other twoweap issues
Report was for dual-wielding hitting an enchanter and assumed that
a resistant artifact as primary weapon was protecting vulnerable
secondary weapon.  Actual reason was simpler.

When in normal form, dual-wielding attacks against creatures which
cause erosion to the weapon which hits them would only inflict the
passive erosion damage to the primary weapon, even if it missed and
secondary hit.  Make primary attack always trigger passive counter-
attack--before second swing now, rather than after--even if it misses,
and secondary attack trigger another one if that hits.  Both weapons
are now subject to passive erosion (but only when they actually hit);
when secondary weapon hits, hero gets a double dose of counter-attack.

Hero poly'd into a monster with multiple weapon attacks (various
leaders:  dwarf lord, orc-captain, and so forth) would try to emulate
dual wielding and first hit with uwep then with uswapwep.  But it
would do that even if uswapwep was a bow or stack of darts that the
player had no itention of using for hand-to-hand.  Stick with repeat
hits by uwep when uswapwep seems inappropriate.

Splitting a pudding while dual-wielding would only do so when hit by
uwep of appropriate material, never when hit by uswapwep.  So silver
saber and longsword could split if longsword was primary but never
split if saber was primary.  Check material and splitting separately
for each hit.  It's now possible to split twice with one dual-weapon
attack if both weapons hit and both are made of the right material
(iron or 'metal'; among relevant objects the latter is only used for
tsurugi and scapel).
2018-01-28 00:38:08 -08:00
nhmall
d2245aab29 version output appearance bits 2018-01-26 17:25:21 -05:00
PatR
a40f0788bc fix object pickup
Mentioned in the newsgroup:  picked up items have stopped merging with
compatible stacks in inventory.

The commit 0c51555849 by me on January 5
|
| fix #H6713 - unpaid_cost: object not on any bill
|
| Stealing a shop object from outside the shop with a grappling hook
| would result in that item being left marked 'unpaid' after the shop's
| bill was treated as being bought and not yet paid for.  This led to
| "unpaid_cost: object wasn't on any bill" every time inventory was
| examined.  The problem was caused by handling the shop robbery after
| removing the object from the floor but before adding it to inventory,
| so it couldn't be found to have its unpaid bit cleared.
|
inadvertently caused that.  The effect was actually deliberate but it
wasn't intended to be so widespread.  Handle extract/bill/addinv/rob
sequencing differently instead of overriding inventory merging.
2018-01-21 16:30:58 -08:00
PatR
c59f9512c7 T-shirt punctuation
'It reads:  "foo bar quux"' is a sentence so should have a terminating
period.  Technically that ought to be placed inside the quotes, but
putting it after distinguishes slogans which have their own punctuation
from ones which don't.

A couple of entries contain multiple sentences.  Some used two-space
separation between those sentences, some only one; make all use two.

Add a few new T-shirt messages, including a couple with pop culture
references which are only 10 years old instead of 20 or more....
2018-01-12 16:13:14 -08:00
Alex Smith
03f8a487d1 Merge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.0 2018-01-06 00:39:17 +00:00
Alex Smith
bad36c8672 Fix an exploit involving bags and potions of water
Discovered while writing the previous commit. If you dipped a sack
full of potions into an uncursed potion of water, the potions would
dilute but you wouldn't lose the original potion, letting you repeat
until all were diluted.

Allowing people to do this trick to blank multiple potions from one
potion of water seems like it's not an abuse, given that it can be
done in a more tedious way with water walking or the like and it
costs resources, but it's definitely abusive to make it possible
entirely for free.
2018-01-06 00:38:37 +00:00
Alex Smith
2b7b2af9eb Give feedback when oilskin sacks get wet
We can identify them by elimination in this case (they're the only
bag-like container that doesn't produce a message, the others all
do), so it's probably best to be more explicit as to what's going
on (for user interfaces and TDTTOE purposes).
2018-01-06 00:38:05 +00:00
PatR
0c51555849 fix #H6713 - unpaid_cost: object not on any bill
Stealing a shop object from outside the shop with a grappling hook
would result in that item being left marked 'unpaid' after the shop's
bill was treated as being bought and not yet paid for.  This led to
"unpaid_cost: object wasn't on any bill" every time inventory was
examined.  The problem was caused by handling the shop robbery after
removing the object from the floor but before adding it to inventory,
so it couldn't be found to have its unpaid bit cleared.

When investigating this I came across a more severe bug:  if the hero
had never entered the shop, the shopkeeper's bill wasn't initialized
properly and add_one_tobill() could crash while attempting to execute
    bp->bo_id = obj->o_id;
because 'bp' was Null.
2018-01-05 01:23:56 -08:00
PatR
66242a0691 fix #H6707 - double "gush of water hits" messages
When polymorphed into an iron golem (or gremlin with 2/3 chance),
triggering a rust trap would give "a gush of water hits <you or some
body part>" and then give a second "a gush of water hits you" when
dealing with golem or gremlin effects.  That made it seem as if the
trap was hitting twice.  This removes the redundant messages.  (Rust
trap against monster iron golem or gremlin didn't have them.)
2018-01-01 17:14:37 -08:00