From: Patric Mueller Date: Sun, 18 Oct 2020 23:52:46 +0000 (+0200) Subject: List lamps and lanterns in charging prompt X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e1cf071ae26dc7080f6a385c97c9e96ad395f6b;p=nethack List lamps and lanterns in charging prompt Brass lanterns and oil lamps are always chargeable. Magic lamps are only listed if they are not yet identified. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 876a2aa12..c068816be 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -579,6 +579,7 @@ render the color names in the corresponding color when using the pick-a-color menu for adding status highlights or menu colors via 'O' reading blessed scroll of teleportation confers one-shot teleport control mild zombie apocalypse +list lamps and lanterns in charging prompt Platform- and/or Interface-Specific New Features diff --git a/src/read.c b/src/read.c index 42b1040a2..bd208a9d6 100644 --- a/src/read.c +++ b/src/read.c @@ -501,8 +501,16 @@ struct obj *obj; && objects[obj->otyp].oc_name_known))); if (is_weptool(obj)) /* specific check before general tools */ return FALSE; - if (obj->oclass == TOOL_CLASS) + if (obj->oclass == TOOL_CLASS) { + if (obj->otyp == BRASS_LANTERN + || (obj->otyp == OIL_LAMP) + /* only list magic lamps if they are not identified yet */ + || (obj->otyp == MAGIC_LAMP + && !objects[MAGIC_LAMP].oc_name_known)) { + return TRUE; + } return (boolean) objects[obj->otyp].oc_charged; + } return FALSE; /* why are weapons/armor considered charged anyway? */ }