From: PatR Date: Mon, 23 May 2022 18:31:48 +0000 (-0700) Subject: named fruit vs glob bit X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99cacd31058ad65da79bdc8a0a7ee36aec49037a;p=nethack named fruit vs glob bit 3.7 has a new size prefix for globs that 3.6 didn't. The code that decides whether player is naming slime molds after an actual object needs to know about it. --- diff --git a/src/options.c b/src/options.c index 04bb64b0e..900dcfb19 100644 --- a/src/options.c +++ b/src/options.c @@ -7230,8 +7230,6 @@ fruitadd(char *str, struct fruit *replace_fruit) str==pl_fruit but makesingular() creates a copy so we need to copy that back into pl_fruit */ nmcpy(g.pl_fruit, makesingular(str), PL_FSIZ); - /* (assertion doesn't matter; we use 'g.pl_fruit' from here on out) */ - /* assert( str == g.pl_fruit ); */ /* disallow naming after other foods (since it'd be impossible * to tell the difference); globs might have a size prefix which @@ -7239,8 +7237,9 @@ fruitadd(char *str, struct fruit *replace_fruit) */ globpfx = (!strncmp(g.pl_fruit, "small ", 6) || !strncmp(g.pl_fruit, "large ", 6)) ? 6 - : (!strncmp(g.pl_fruit, "very large ", 11)) ? 11 - : 0; + : (!strncmp(g.pl_fruit, "medium ", 7)) ? 7 + : (!strncmp(g.pl_fruit, "very large ", 11)) ? 11 + : 0; for (i = g.bases[FOOD_CLASS]; objects[i].oc_class == FOOD_CLASS; i++) { if (!strcmp(OBJ_NAME(objects[i]), g.pl_fruit) || (globpfx > 0