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:
22
src/mkroom.c
22
src/mkroom.c
@@ -622,10 +622,13 @@ boolean
|
||||
has_dnstairs(sroom)
|
||||
register struct mkroom *sroom;
|
||||
{
|
||||
if (sroom == g.dnstairs_room)
|
||||
return TRUE;
|
||||
if (g.sstairs.sx && !g.sstairs.up)
|
||||
return (boolean) (sroom == g.sstairs_room);
|
||||
stairway *stway = g.stairs;
|
||||
|
||||
while (stway) {
|
||||
if (!stway->up && inside_room(sroom, stway->sx, stway->sy))
|
||||
return TRUE;
|
||||
stway = stway->next;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -633,10 +636,13 @@ boolean
|
||||
has_upstairs(sroom)
|
||||
register struct mkroom *sroom;
|
||||
{
|
||||
if (sroom == g.upstairs_room)
|
||||
return TRUE;
|
||||
if (g.sstairs.sx && g.sstairs.up)
|
||||
return (boolean) (sroom == g.sstairs_room);
|
||||
stairway *stway = g.stairs;
|
||||
|
||||
while (stway) {
|
||||
if (stway->up && inside_room(sroom, stway->sx, stway->sy))
|
||||
return TRUE;
|
||||
stway = stway->next;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user