Remove the per dungeon level door limit

Number of doors in a room-and-corridor style level was fixed
at 120; now the doors-array is dynamically allocated when needed.

Breaks saves and bones.
This commit is contained in:
Pasi Kallinen
2022-09-09 19:40:45 +03:00
parent c6a8519fec
commit a733004912
10 changed files with 85 additions and 62 deletions
+5 -1
View File
@@ -1068,7 +1068,11 @@ getlev(NHFILE* nhfp, int pid, xint8 lev)
mread(nhfp->fd, (genericptr_t)&g.updest, sizeof(dest_area));
mread(nhfp->fd, (genericptr_t)&g.dndest, sizeof(dest_area));
mread(nhfp->fd, (genericptr_t)&g.level.flags, sizeof(g.level.flags));
mread(nhfp->fd, (genericptr_t)g.doors, sizeof(g.doors));
if (g.doors)
free(g.doors);
mread(nhfp->fd, (genericptr_t) &g.doors_alloc, sizeof (g.doors_alloc));
g.doors = (coord *) alloc(g.doors_alloc * sizeof (coord));
mread(nhfp->fd, (genericptr_t) g.doors, g.doors_alloc * sizeof (coord));
}
rest_rooms(nhfp); /* No joke :-) */
if (g.nroom)