Fix traps generated inside walls
When fuzzing, noticed a trap generated inside a wall. Culprit was one of the themed rooms that generates a rectangular room and then puts freestanding wall columns inside. Note in somexy that it can return a non-accessible location, and change the places that used it and absolutely needed a space to somexyspace.
This commit is contained in:
@@ -1478,7 +1478,7 @@ mktrap(
|
||||
return;
|
||||
if (mktrapflags & MKTRAP_MAZEFLAG)
|
||||
mazexy(&m);
|
||||
else if (!somexy(croom, &m))
|
||||
else if (!somexyspace(croom, &m))
|
||||
return;
|
||||
} while (occupied(m.x, m.y)
|
||||
|| (avoid_boulder && sobj_at(BOULDER, m.x, m.y)));
|
||||
@@ -1778,7 +1778,7 @@ find_okay_roompos(struct mkroom *croom, coord *crd)
|
||||
do {
|
||||
if (++tryct > 200)
|
||||
return FALSE;
|
||||
if (!somexy(croom, crd))
|
||||
if (!somexyspace(croom, crd))
|
||||
return FALSE;
|
||||
} while (occupied(crd->x, crd->y) || bydoor(crd->x, crd->y));
|
||||
return TRUE;
|
||||
|
||||
Reference in New Issue
Block a user