]> granicus.if.org Git - nethack/commitdiff
List lamps and lanterns in charging prompt
authorPatric Mueller <bhaak@gmx.net>
Sun, 18 Oct 2020 23:52:46 +0000 (01:52 +0200)
committerPatric Mueller <bhaak@gmx.net>
Sun, 25 Oct 2020 18:25:39 +0000 (19:25 +0100)
Brass lanterns and oil lamps are always chargeable.
Magic lamps are only listed if they are not yet identified.

doc/fixes37.0
src/read.c

index 876a2aa128941abc625c227e996fac1d010f18a6..c068816bec1c462488315e25df5de80bc04ad46e 100644 (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
index 42b1040a2e060ee3b46e49e652d50fa9642f4a53..bd208a9d6ecf0d378cea8c3f82653496c867cd2e 100644 (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? */
 }