]> granicus.if.org Git - nethack/commitdiff
lit candles generated by wishing could have wrong light radius
authorPatric Mueller <bhaak@gmx.net>
Fri, 26 Aug 2022 19:36:42 +0000 (21:36 +0200)
committerPatric Mueller <bhaak@gmx.net>
Fri, 26 Aug 2022 19:54:56 +0000 (21:54 +0200)
begin_burn() was called before the quantity of wished lit candles was
restricted which meant that the light source radius could depend on a
larger quantity than the final object actually had.

doc/fixes3-7-0.txt
src/objnam.c

index 7a88b44467eab2440df40304a63ae54f6e3a604b..131620155fdcc658d8e557d1c2bb53c4e11c746a 100644 (file)
@@ -1016,6 +1016,7 @@ monsters which cannot move due to boulders or walls try to escape
 intelligent monsters see and remember when others trigger traps
 random figurines are of harder monsters
 monsters can blind you with a camera
+lit candles generated by wishing could have wrong light radius
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index fba567353357fb8c2a6b763ae13ebcbe299e02df..08406c627b32285923252982e362ded959115a8a 100644 (file)
@@ -4590,14 +4590,6 @@ readobjnam(char *bp, struct obj *no_wish)
     d.otmp = d.typ ? mksobj(d.typ, TRUE, FALSE) : mkobj(d.oclass, FALSE);
     d.typ = d.otmp->otyp, d.oclass = d.otmp->oclass; /* what we actually got */
 
-    if (d.islit && (d.typ == OIL_LAMP || d.typ == MAGIC_LAMP
-                    || d.typ == BRASS_LANTERN
-                    || Is_candle(d.otmp) || d.typ == POT_OIL)) {
-        place_object(d.otmp, u.ux, u.uy); /* make it viable light source */
-        begin_burn(d.otmp, FALSE);
-        obj_extract_self(d.otmp); /* now release it for caller's use */
-    }
-
     /* if player specified a reasonable count, maybe honor it;
        quantity for gold is handled elsewhere and d.cnt is 0 for it here */
     if (d.otmp->globby) {
@@ -4644,6 +4636,14 @@ readobjnam(char *bp, struct obj *no_wish)
             d.otmp->quan = (long) d.cnt;
     }
 
+    if (d.islit && (d.typ == OIL_LAMP || d.typ == MAGIC_LAMP
+                    || d.typ == BRASS_LANTERN
+                    || Is_candle(d.otmp) || d.typ == POT_OIL)) {
+        place_object(d.otmp, u.ux, u.uy); /* make it viable light source */
+        begin_burn(d.otmp, FALSE);
+        obj_extract_self(d.otmp); /* now release it for caller's use */
+    }
+
     if (d.spesgn == 0) {
         /* spe not specifed; retain the randomly assigned value */
         d.spe = d.otmp->spe;