fix issue #319 - whip can fetch underwater items

Applying a bullwhip down while levitating or riding gives a chance
to pick up items from the unreachable floor.  Doing so over water
yields "you wrap your bullwhip around <item> on the water" when
that item is actually on the bottom.  Same for lava.  Don't fetch
items from beneath the surface.  Also, for the lava case subject
the whip to fire damage.

This has actually broken the seal on a can of worms.  Every item
at a water location sinks to the bottom even if it should float.
I'm not opening that can....

Fixes #319
This commit is contained in:
PatR
2020-04-23 16:54:51 -07:00
parent 3468129f5a
commit ff483694af
2 changed files with 8 additions and 0 deletions

View File

@@ -2668,6 +2668,12 @@ struct obj *obj;
kick_steed();
return 1;
}
if (is_pool_or_lava(u.ux, u.uy)) {
You("cause a small splash.");
if (is_lava(u.ux, u.uy))
(void) fire_damage(uwep, FALSE, u.ux, u.uy);
return 1;
}
if (Levitation || u.usteed) {
/* Have a shot at snaring something on the floor */
otmp = g.level.objects[u.ux][u.uy];