/* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */
/* 8: travel */
unsigned startingpet_mid;
+ int current_fruit; /* fruit->fid corresponding to pl_fruit[] */
int warnlevel;
int rndencode; /* randomized escape sequence introducer */
long next_attrib_check; /* next attribute check */
-/* SCCS Id: @(#)decl.h 3.5 2008/01/30 */
+/* SCCS Id: @(#)decl.h 3.5 2008/07/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
E NEARDATA char pl_race; /* character's race */
E NEARDATA char pl_fruit[PL_FSIZ];
-E NEARDATA int current_fruit;
E NEARDATA struct fruit *ffruit;
E NEARDATA char tune[6];
-/* SCCS Id: @(#)patchlevel.h 3.5 2007/04/01 */
+/* SCCS Id: @(#)patchlevel.h 3.5 2008/07/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
-#define EDITLEVEL 40
+#define EDITLEVEL 41
#define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2007"
-/* SCCS Id: @(#)decl.c 3.5 2008/01/30 */
+/* SCCS Id: @(#)decl.c 3.5 2008/07/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
NEARDATA char pl_race = '\0';
NEARDATA char pl_fruit[PL_FSIZ] = DUMMY;
-NEARDATA int current_fruit = 0;
NEARDATA struct fruit *ffruit = (struct fruit *)0;
NEARDATA char tune[6] = DUMMY;
-/* SCCS Id: @(#)eat.c 3.5 2008/05/26 */
+/* SCCS Id: @(#)eat.c 3.5 2008/07/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
}
/* Fall through otherwise */
default:
- if (otmp->otyp==SLIME_MOLD && !otmp->cursed
- && otmp->spe == current_fruit)
+ if (otmp->otyp == SLIME_MOLD && !otmp->cursed &&
+ otmp->spe == context.current_fruit)
pline("My, that was a %s %s!",
Hallucination ? "primo" : "yummy",
singular(otmp, xname));
-/* SCCS Id: @(#)mkobj.c 3.5 2007/11/10 */
+/* SCCS Id: @(#)mkobj.c 3.5 2008/07/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
blessorcurse(otmp, 10);
break;
case SLIME_MOLD:
- otmp->spe = current_fruit;
+ otmp->spe = context.current_fruit;
break;
case KELP_FROND:
otmp->quan = (long) rnd(2);
-/* SCCS Id: @(#)objnam.c 3.5 2008/01/23 */
+/* SCCS Id: @(#)objnam.c 3.5 2008/07/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
int islit, unlabeled, ishistoric, isdiluted, trapped;
int tmp, tinv, tvariety;
struct fruit *f;
- int ftype = current_fruit;
+ int ftype = context.current_fruit;
char fruitbuf[BUFSZ];
/* Fruits may not mess up the ability to wish for real objects (since
* you can leave a fruit in a bones file and it will be added to
-/* SCCS Id: @(#)options.c 3.5 2008/02/19 */
+/* SCCS Id: @(#)options.c 3.5 2008/07/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
lastf = f;
if(f->fid > highest_fruit_id) highest_fruit_id = f->fid;
if (!strncmp(str, f->fname, PL_FSIZ-1) ||
- (*altname && !strcmp(altname, f->fname))) {
- highest_fruit_id = f->fid;
+ (*altname && !strcmp(altname, f->fname)))
goto nonew;
- }
}
/* if adding another fruit would overflow spe, use a random
- fruit instead... we've got a lot to choose from. */
+ fruit instead... we've got a lot to choose from.
+ current_fruit remains as is. */
if (highest_fruit_id >= 127) return rnd(127);
highest_fruit_id++;
f = newfruit();
copynchars(f->fname, *altname ? altname : str, PL_FSIZ-1);
f->fid = highest_fruit_id;
f->nextf = 0;
-nonew:
- if (user_specified) current_fruit = highest_fruit_id;
+ nonew:
+ if (user_specified) context.current_fruit = f->fid;
return f->fid;
}
-/* SCCS Id: @(#)pager.c 3.5 2008/03/19 */
+/* SCCS Id: @(#)pager.c 3.5 2008/07/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
if (otmp->oclass == COIN_CLASS)
otmp->quan = 2L; /* to force pluralization */
else if (otmp->otyp == SLIME_MOLD)
- otmp->spe = current_fruit; /* give the fruit a type */
+ otmp->spe = context.current_fruit; /* give it a type */
Strcpy(buf, distant_name(otmp, xname));
dealloc_obj(otmp);
}
-/* SCCS Id: @(#)restore.c 3.5 2007/04/21 */
+/* SCCS Id: @(#)restore.c 3.5 2008/07/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
mread(fd, (genericptr_t) pl_character, sizeof pl_character);
mread(fd, (genericptr_t) pl_fruit, sizeof pl_fruit);
- mread(fd, (genericptr_t) ¤t_fruit, sizeof current_fruit);
freefruitchn(ffruit); /* clean up fruit(s) made by initoptions() */
ffruit = loadfruitchn(fd);
-/* SCCS Id: @(#)save.c 3.5 2007/01/08 */
+/* SCCS Id: @(#)save.c 3.5 2008/07/20 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
#endif
bwrite(fd, (genericptr_t) pl_character, sizeof pl_character);
bwrite(fd, (genericptr_t) pl_fruit, sizeof pl_fruit);
- bwrite(fd, (genericptr_t) ¤t_fruit, sizeof current_fruit);
savefruitchn(fd, mode);
savenames(fd, mode);
save_waterlevel(fd, mode);