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:
Pasi Kallinen
2022-09-09 12:03:12 +03:00
parent 3ee6bcdf76
commit 82867ccdaf
3 changed files with 12 additions and 7 deletions
+2 -2
View File
@@ -500,7 +500,7 @@ vault_tele(void)
register struct mkroom *croom = search_special(VAULT);
coord c;
if (croom && somexy(croom, &c) && teleok(c.x, c.y, FALSE)) {
if (croom && somexyspace(croom, &c) && teleok(c.x, c.y, FALSE)) {
teleds(c.x, c.y, TELEDS_TELEPORT);
return;
}
@@ -1465,7 +1465,7 @@ mvault_tele(struct monst* mtmp)
struct mkroom *croom = search_special(VAULT);
coord c;
if (croom && somexy(croom, &c) && goodpos(c.x, c.y, mtmp, 0)) {
if (croom && somexyspace(croom, &c) && goodpos(c.x, c.y, mtmp, 0)) {
rloc_to(mtmp, c.x, c.y);
return;
}