]> granicus.if.org Git - nethack/commitdiff
Use existing function for stumbling on door mimic
authorPasi Kallinen <paxed@alt.org>
Sun, 18 Oct 2015 06:57:07 +0000 (09:57 +0300)
committerPasi Kallinen <paxed@alt.org>
Sun, 18 Oct 2015 06:57:07 +0000 (09:57 +0300)
src/lock.c

index 2bba9c8cec6832aaa892e476e7c18f35e5878a53..c2c06067af9b7db682c3847f675df0b18a4b3744 100644 (file)
@@ -721,12 +721,8 @@ int doclose() /* try to close a door */
     if (!isok(x, y))
         goto nodoor;
 
-    if ((mtmp = m_at(x, y)) && mtmp->m_ap_type == M_AP_FURNITURE
-        && (mtmp->mappearance == S_hcdoor || mtmp->mappearance == S_vcdoor)
-        && !Protection_from_shape_changers) {
-        stumble_onto_mimic(mtmp);
+    if (stumble_on_door_mimic(x, y))
         return (1);
-    }
 
     /* when choosing a direction is impaired, use a turn
        regardless of whether a door is successfully targetted */