Debug panic when level has too many (sub)rooms
This commit is contained in:
10
src/mklev.c
10
src/mklev.c
@@ -306,6 +306,10 @@ add_room(coordxy lowx, coordxy lowy, coordxy hix, coordxy hiy,
|
||||
{
|
||||
struct mkroom *croom;
|
||||
|
||||
#ifdef DEBUG
|
||||
if (svn.nroom >= MAXNROFROOMS)
|
||||
panic("level has too many rooms");
|
||||
#endif /*DEBUG*/
|
||||
croom = &svr.rooms[svn.nroom];
|
||||
do_room_or_subroom(croom, lowx, lowy, hix, hiy, lit, rtype, special,
|
||||
(boolean) TRUE);
|
||||
@@ -322,6 +326,12 @@ add_subroom(struct mkroom *proom,
|
||||
{
|
||||
struct mkroom *croom;
|
||||
|
||||
#ifdef DEBUG
|
||||
if (gn.nsubroom >= MAXNROFROOMS)
|
||||
panic("level has too many subrooms");
|
||||
if (proom->nsubrooms >= MAX_SUBROOMS)
|
||||
panic("room has too many subrooms");
|
||||
#endif /*DEBUG*/
|
||||
croom = &gs.subrooms[gn.nsubroom];
|
||||
do_room_or_subroom(croom, lowx, lowy, hix, hiy, lit, rtype, special,
|
||||
(boolean) FALSE);
|
||||
|
||||
Reference in New Issue
Block a user