fix #H2210 - unlocking a mimic masquerading as a door (trunk only)

From a bug report, attempting to use a key,
lock pick, or credit card on an open doorway that contained a mimic posing
as a closed door reported "that doorway has no door" or "you cannot lock
an open door" as if no monster was present, and failed to find the mimic.
This commit is contained in:
nethack.rankin
2011-01-01 00:34:19 +00:00
parent 9b1f0899b0
commit 1dcaa1621b
2 changed files with 14 additions and 3 deletions
+2
View File
@@ -340,6 +340,8 @@ fix writing feedback "the spellbook warps strangely, then turns parchment"
make stone artifacts usually resist stone-to-flesh make stone artifacts usually resist stone-to-flesh
when reading an unknown scroll and learning it, discovery of teleporation was when reading an unknown scroll and learning it, discovery of teleporation was
too late if hero happened to land on another scroll of teleportation too late if hero happened to land on another scroll of teleportation
using an unlocking tool on a closed door which was actually a mimic reported
that there was no door to unlock instead of exposing the mimic
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+12 -3
View File
@@ -387,9 +387,10 @@ pick_lock(pick)
} }
door = &levl[cc.x][cc.y]; door = &levl[cc.x][cc.y];
if ((mtmp = m_at(cc.x, cc.y)) && canseemon(mtmp) mtmp = m_at(cc.x, cc.y);
&& mtmp->m_ap_type != M_AP_FURNITURE if (mtmp && canseemon(mtmp) &&
&& mtmp->m_ap_type != M_AP_OBJECT) { mtmp->m_ap_type != M_AP_FURNITURE &&
mtmp->m_ap_type != M_AP_OBJECT) {
#ifdef TOURIST #ifdef TOURIST
if (picktyp == CREDIT_CARD && if (picktyp == CREDIT_CARD &&
(mtmp->isshk || mtmp->data == &mons[PM_ORACLE])) (mtmp->isshk || mtmp->data == &mons[PM_ORACLE]))
@@ -398,6 +399,14 @@ pick_lock(pick)
#endif #endif
pline("I don't think %s would appreciate that.", mon_nam(mtmp)); pline("I don't think %s would appreciate that.", mon_nam(mtmp));
return PICKLOCK_LEARNED_SOMETHING; return PICKLOCK_LEARNED_SOMETHING;
} else if (mtmp && mtmp->m_ap_type == M_AP_FURNITURE &&
/* not IS_DOOR() here; for M_AP_FURNITURE, mappearance
holds a map symbol rather than a topology type */
(mtmp->mappearance == S_vcdoor ||
mtmp->mappearance == S_hcdoor)) {
/* "The door actually was a <mimic>!" */
stumble_onto_mimic(mtmp);
return PICKLOCK_LEARNED_SOMETHING;
} }
if(!IS_DOOR(door->typ)) { if(!IS_DOOR(door->typ)) {
if (is_drawbridge_wall(cc.x,cc.y) >= 0) if (is_drawbridge_wall(cc.x,cc.y) >= 0)