Prevent array underflow

This commit is contained in:
Pasi Kallinen
2015-11-01 01:44:10 +02:00
parent 6399347d9f
commit b44486e7cc

View File

@@ -16,8 +16,9 @@ struct monst *mon;
int rmtyp;
{
int rno = levl[mon->mx][mon->my].roomno;
return rooms[rno - ROOMOFFSET].rtype == rmtyp;
if (rno >= ROOMOFFSET)
return rooms[rno - ROOMOFFSET].rtype == rmtyp;
return FALSE;
}
void