Prevent array underflow
This commit is contained in:
+3
-2
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user