]> granicus.if.org Git - nethack/commitdiff
candelabrum wording
authornethack.allison <nethack.allison>
Mon, 20 Dec 2004 23:57:02 +0000 (23:57 +0000)
committernethack.allison <nethack.allison>
Mon, 20 Dec 2004 23:57:02 +0000 (23:57 +0000)
On Sat, 18 Dec 2004 14:07:14 +1300, <email deleted> wrote:
> Adding one of several candles to a candelabrum which already has six
> gives an ungrammatical message.

doc/fixes34.4
src/apply.c

index 14de95848b285d515d94631a456c94805f350411..dacc71c5ad4584cc769bb9f9f95bbe75f574ea67 100644 (file)
@@ -76,6 +76,8 @@ monsters "shrieking in pain" from a potion didn't wake anything up
 Master of Thieves as Tourist Nemesis still had STRAT_CLOSE
 co-aligned unicorns in bones could be hostile
 finding "something" posing as a statue while Blind should map_invisible()
+adding more candles than required to total 7 to a candelabrum which 
+       already had between 1 and 6 gave an ungrammatical message
 
 
 Platform- and/or Interface-Specific Fixes
index 45df4545d4e669b1860244221bd7476cd5af9ceb..75c7e1f566cda848b9839942bfd751a013e3c175 100644 (file)
@@ -1026,9 +1026,12 @@ struct obj **optr;
                use_lamp(obj);
                return;
        } else {
-               if ((long)otmp->spe + obj->quan > 7L)
+               if ((long)otmp->spe + obj->quan > 7L) {
                    obj = splitobj(obj, 7L - (long)otmp->spe);
-               else *optr = 0;
+                   /* avoid a gramatical error if obj->quan gets
+                      reduced to 1 candle from more than one */
+                   s = (obj->quan != 1) ? "candles" : "candle";
+               } else *optr = 0;
                You("attach %ld%s %s to %s.",
                    obj->quan, !otmp->spe ? "" : " more",
                    s, the(xname(otmp)));