From 65b9429b602ea20b5d1fd9577e4fa0a76ecf3001 Mon Sep 17 00:00:00 2001
From: PatR <rankin@nethack.org>
Date: Sat, 9 Apr 2016 18:51:28 -0700
Subject: [PATCH] fix #H4296 - grease no checked for passive damage

Hitting a rust monster with a greased weapon would rust the weapon
instead of removing the grease.  Likewise for monsters with passive
acid or corrosion damage.  passive_obj() was ignoring grease.
---
 doc/fixes36.1 | 2 ++
 src/uhitm.c   | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/doc/fixes36.1 b/doc/fixes36.1
index 4c72bf86d..0592a4637 100644
--- a/doc/fixes36.1
+++ b/doc/fixes36.1
@@ -201,6 +201,8 @@ tweak Baalzebub's lair and clean up the map display for it
 symbol set definitions didn't recognize S_darkroom and S_vibrating_square
 wizard mode enlightenment was reporting "very fast innately" (which is not
 	possible) for very fast hero who was innately fast
+when attacking a monster with a rust or corrosion or acid passive
+	counter-attack, grease wasn't protecting the attacker's weapon
 
 post-3.6.0: fix "object lost" panic during pickup caused by sortloot revamp
 post-3.6.0: more sortloot revisions
diff --git a/src/uhitm.c b/src/uhitm.c
index 48a16883f..4512006dc 100644
--- a/src/uhitm.c
+++ b/src/uhitm.c
@@ -2550,17 +2550,17 @@ struct attack *mattk;     /* null means we find one internally */
         break;
     case AD_ACID:
         if (!rn2(6)) {
-            (void) erode_obj(obj, NULL, ERODE_CORRODE, EF_NONE);
+            (void) erode_obj(obj, NULL, ERODE_CORRODE, EF_GREASE);
         }
         break;
     case AD_RUST:
         if (!mon->mcan) {
-            (void) erode_obj(obj, NULL, ERODE_RUST, EF_NONE);
+            (void) erode_obj(obj, (char *) 0, ERODE_RUST, EF_GREASE);
         }
         break;
     case AD_CORR:
         if (!mon->mcan) {
-            (void) erode_obj(obj, NULL, ERODE_CORRODE, EF_NONE);
+            (void) erode_obj(obj, (char *) 0, ERODE_CORRODE, EF_GREASE);
         }
         break;
     case AD_ENCH:
-- 
2.40.0