]> granicus.if.org Git - nethack/commitdiff
Don't show rusting of items landing in water
authorPasi Kallinen <paxed@alt.org>
Fri, 11 Feb 2022 18:13:20 +0000 (20:13 +0200)
committerPasi Kallinen <paxed@alt.org>
Fri, 11 Feb 2022 18:20:24 +0000 (20:20 +0200)
When a thrown item lands in a pool of water, it immediately
rusts - but don't give that message unless the hero is at the same
location and also under the water.  My reasoning: hero can't see items
under water, and by the time the item rusts, it's in the water.

doc/fixes3-7-0.txt
src/trap.c

index 8b31320bcb1d32810e28742acbb6815efb151353..5403d3ea1a30369af265f7c5e91f91246f808d78 100644 (file)
@@ -776,6 +776,7 @@ add unique Rider revival messages
 don't dereference NULL u.ustuck in dobuzz() when hero has been swallowed
 monsters should growl even if you can't hear it
 give a sound effect message when thrown item lands in water or lava
+don't show rusting of items that land in water
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index 9b0b2025dd07620b73546a7b9a90d3b9ed3afd0b..720fef77882c86ac87d96f093f94a3f5f1f0df15 100644 (file)
@@ -182,7 +182,9 @@ erode_obj(
     uvictim = (victim == &g.youmonst);
     vismon = victim && (victim != &g.youmonst) && canseemon(victim);
     /* Is g.bhitpos correct here? Ugh. */
-    visobj = !victim && cansee(g.bhitpos.x, g.bhitpos.y);
+    visobj = !victim && cansee(g.bhitpos.x, g.bhitpos.y)
+        && (!is_pool(g.bhitpos.x, g.bhitpos.y)
+            || (u.ux == g.bhitpos.x && u.uy == g.bhitpos.y && Underwater));
 
     switch (type) {
     case ERODE_BURN: