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.
This commit is contained in:
Patric Mueller
2020-10-19 01:52:46 +02:00
parent 22ca1ae4da
commit 4e1cf071ae
2 changed files with 10 additions and 1 deletions

View File

@@ -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

View File

@@ -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? */
}