monsters capable of hiding can't do so when trapped or while holding you
limit recursive calls to spoteffects (poly'd hero fell into water, reverted
to human because of it, fell into same water, then crawled out twice)
+ensure that the punishment ball and chain make it into the save file after being
+ temporarily orphaned from the normal chains in the swallowing code
Platform- and/or Interface-Specific Fixes
/* Some misc definitions */
#define POTION_OCCUPANT_CHANCE(n) (13 + 2*(n))
#define WAND_BACKFIRE_CHANCE 100
+#define BALL_IN_MON (u.uswallow && uball && uball->where == OBJ_FREE)
/* Flags to control menus */
#define MENUTYPELEN sizeof("traditional ")
* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
-#define EDITLEVEL 31
+#define EDITLEVEL 32
#define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2006"
{
/* discover is actually flags.explore */
boolean remember_discover = discover;
- struct obj *otmp;
+ struct obj *otmp, *tmp_bc;
int uid;
mread(fd, (genericptr_t) &uid, sizeof uid);
#ifndef GOLDOBJ
put_gold_back(&invent, &u.ugold);
#endif
+ /* tmp_bc only gets set here if the ball & chain were orphaned
+ because you were swallowed; otherwise they will be on the floor
+ or in your inventory */
+ tmp_bc = restobjchn(fd, FALSE, FALSE);
+ if (tmp_bc) {
+ for(otmp = tmp_bc; otmp; otmp = otmp->nobj) {
+ if(otmp->owornmask)
+ setworn(otmp, otmp->owornmask);
+ }
+ if (!uball || !uchain)
+ impossible("restgamestate: lost ball & chain");
+ }
+
migrating_objs = restobjchn(fd, FALSE, FALSE);
migrating_mons = restmonchn(fd, FALSE);
mread(fd, (genericptr_t) mvitals, sizeof(mvitals));
if (!release_data(mode))
put_gold_back(&invent, &u.ugold);
#endif
+ if (BALL_IN_MON) {
+ /* prevent loss of ball & chain when swallowed */
+ uball->nobj = uchain;
+ uchain->nobj = (struct obj *)0;
+ saveobjchn(fd, uball, mode);
+ }
+
saveobjchn(fd, migrating_objs, mode);
savemonchn(fd, migrating_mons, mode);
if (release_data(mode)) {