WIZKIT inventory overflow (trunk only)

Wizard mode's $WIZKIT can specify an unlimited number of items to
add to starting inventory and they'd be put there without regard to the
number of slots in use, potentially resulting in an arbitrary number of
'#' slot items.  Cap at 52 slots, same as when picking up, and put any
excess items at the hero's feet.  It's slightly tricky because the level
hasn't been created yet at the time the wizkit gets processed.
This commit is contained in:
nethack.rankin
2007-06-16 04:18:14 +00:00
parent 2ad3afee05
commit d1387f2b6b
5 changed files with 35 additions and 9 deletions

View File

@@ -1430,7 +1430,7 @@ boolean near_hero;
register struct obj *otmp, *otmp2;
register int nx, ny;
long where;
boolean nobreak;
boolean nobreak, noscatter = FALSE;
for (otmp = migrating_objs; otmp; otmp = otmp2) {
otmp2 = otmp->nobj;
@@ -1453,6 +1453,7 @@ boolean near_hero;
break;
case MIGR_SSTAIRS: nx = sstairs.sx, ny = sstairs.sy;
break;
case MIGR_AT_HERO: noscatter = TRUE; /*FALLTHRU*/
case MIGR_NEAR_PLAYER: nx = u.ux, ny = u.uy;
break;
default:
@@ -1471,7 +1472,7 @@ boolean near_hero;
}
}
stackobj(otmp);
(void)scatter(nx, ny, rnd(2), 0, otmp);
if (!noscatter) (void)scatter(nx, ny, rnd(2), 0, otmp);
} else { /* random location */
/* set dummy coordinates because there's no
current position for rloco() to update */