Prevent array underflow

This commit is contained in:
Pasi Kallinen
2015-11-01 01:44:10 +02:00
parent 6399347d9f
commit b44486e7cc
+3 -2
View File
@@ -16,8 +16,9 @@ struct monst *mon;
int rmtyp; int rmtyp;
{ {
int rno = levl[mon->mx][mon->my].roomno; int rno = levl[mon->mx][mon->my].roomno;
if (rno >= ROOMOFFSET)
return rooms[rno - ROOMOFFSET].rtype == rmtyp; return rooms[rno - ROOMOFFSET].rtype == rmtyp;
return FALSE;
} }
void void