fix #H6960 - redundant feedback for '#force'
When using #force at a spot which has a broken or unlocked chest (or large box) whose lock state has been previously discovered, avoid |There is a broken chest here, but its lock is already broken. |There is an unlocked chest here, but its lock is already unlocked. by suppressing "broken"/"unlocked" from the chest description for that particular message. We might still want to change "broken chest" to "damaged chest" but I don't think there should be any reference to its lock as the reason it's broken or damaged. The fact that #loot, #force, and applying a key still treat it as a container is sufficient to reveal that it functions as one.
This commit is contained in:
11
src/lock.c
11
src/lock.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 lock.c $NHDT-Date: 1521377334 2018/03/18 12:48:54 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.78 $ */
|
||||
/* NetHack 3.6 lock.c $NHDT-Date: 1521499715 2018/03/19 22:48:35 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.80 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -549,8 +549,13 @@ doforce()
|
||||
for (otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere)
|
||||
if (Is_box(otmp)) {
|
||||
if (otmp->obroken || !otmp->olocked) {
|
||||
There("is %s here, but its lock is already %s.", doname(otmp),
|
||||
otmp->obroken ? "broken" : "unlocked");
|
||||
/* force doname() to omit known "broken" or "unlocked"
|
||||
prefix so that the message isn't worded redundantly;
|
||||
since we're about to set lknown, there's no need to
|
||||
remember and then reset its current value */
|
||||
otmp->lknown = 0;
|
||||
There("is %s here, but its lock is already %s.",
|
||||
doname(otmp), otmp->obroken ? "broken" : "unlocked");
|
||||
otmp->lknown = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user