Rework stairs structure
Use a linked list to store stair and ladder information, instead of having fixed up/down stairs/ladders and a single "special" (branch) stair. Breaks saves and bones. Adds information to migrating objects and monsters for the dungeon and level where they are migrating from.
This commit is contained in:
11
src/invent.c
11
src/invent.c
@@ -3362,6 +3362,7 @@ char *buf;
|
||||
int ltyp = lev->typ, cmap = -1;
|
||||
const char *dfeature = 0;
|
||||
static char altbuf[BUFSZ];
|
||||
stairway *stway = stairway_at(x,y);
|
||||
|
||||
if (IS_DOOR(ltyp)) {
|
||||
switch (lev->doormask) {
|
||||
@@ -3402,15 +3403,13 @@ char *buf;
|
||||
a_gname(),
|
||||
align_str(Amask2align(lev->altarmask & ~AM_SHRINE)));
|
||||
dfeature = altbuf;
|
||||
} else if ((x == xupstair && y == yupstair)
|
||||
|| (x == g.sstairs.sx && y == g.sstairs.sy && g.sstairs.up))
|
||||
} else if (stway && !stway->isladder && stway->up)
|
||||
cmap = S_upstair; /* "staircase up" */
|
||||
else if ((x == xdnstair && y == ydnstair)
|
||||
|| (x == g.sstairs.sx && y == g.sstairs.sy && !g.sstairs.up))
|
||||
else if (stway && !stway->isladder && !stway->up)
|
||||
cmap = S_dnstair; /* "staircase down" */
|
||||
else if (x == xupladder && y == yupladder)
|
||||
else if (stway && stway->isladder && stway->up)
|
||||
cmap = S_upladder; /* "ladder up" */
|
||||
else if (x == xdnladder && y == ydnladder)
|
||||
else if (stway && stway->isladder && !stway->up)
|
||||
cmap = S_dnladder; /* "ladder down" */
|
||||
else if (ltyp == DRAWBRIDGE_DOWN)
|
||||
cmap = S_vodbridge; /* "lowered drawbridge" */
|
||||
|
||||
Reference in New Issue
Block a user