Make sure random doors don't open into solid wall
When making a random door into a random wall or random position in a room, keep trying harder to find a location that doesn't have solid wall behind it. Fixes the Wizard tower door.
This commit is contained in:
@@ -109,6 +109,7 @@ reinstate ranked ordering of the status condition fields
|
|||||||
grammar for messages about a monster removing items from a container was bad
|
grammar for messages about a monster removing items from a container was bad
|
||||||
some new status conditions didn't always update when they should
|
some new status conditions didn't always update when they should
|
||||||
fix flipping non-existent stairs and ladders (github #311)
|
fix flipping non-existent stairs and ladders (github #311)
|
||||||
|
fix door created into random wall or position opening into solid wall
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
+4
-4
@@ -1503,7 +1503,7 @@ struct mkroom *broom;
|
|||||||
y = broom->ly - 1;
|
y = broom->ly - 1;
|
||||||
x = broom->lx
|
x = broom->lx
|
||||||
+ ((dpos == -1) ? rn2(1 + (broom->hx - broom->lx)) : dpos);
|
+ ((dpos == -1) ? rn2(1 + (broom->hx - broom->lx)) : dpos);
|
||||||
if (!isok(x,y - 1))
|
if (!isok(x,y - 1) || IS_ROCK(levl[x][y - 1].typ))
|
||||||
goto redoloop;
|
goto redoloop;
|
||||||
goto outdirloop;
|
goto outdirloop;
|
||||||
case 1:
|
case 1:
|
||||||
@@ -1512,7 +1512,7 @@ struct mkroom *broom;
|
|||||||
y = broom->hy + 1;
|
y = broom->hy + 1;
|
||||||
x = broom->lx
|
x = broom->lx
|
||||||
+ ((dpos == -1) ? rn2(1 + (broom->hx - broom->lx)) : dpos);
|
+ ((dpos == -1) ? rn2(1 + (broom->hx - broom->lx)) : dpos);
|
||||||
if (!isok(x,y + 1))
|
if (!isok(x,y + 1) || IS_ROCK(levl[x][y + 1].typ))
|
||||||
goto redoloop;
|
goto redoloop;
|
||||||
goto outdirloop;
|
goto outdirloop;
|
||||||
case 2:
|
case 2:
|
||||||
@@ -1521,7 +1521,7 @@ struct mkroom *broom;
|
|||||||
x = broom->lx - 1;
|
x = broom->lx - 1;
|
||||||
y = broom->ly
|
y = broom->ly
|
||||||
+ ((dpos == -1) ? rn2(1 + (broom->hy - broom->ly)) : dpos);
|
+ ((dpos == -1) ? rn2(1 + (broom->hy - broom->ly)) : dpos);
|
||||||
if (!isok(x - 1,y))
|
if (!isok(x - 1,y) || IS_ROCK(levl[x - 1][y].typ))
|
||||||
goto redoloop;
|
goto redoloop;
|
||||||
goto outdirloop;
|
goto outdirloop;
|
||||||
case 3:
|
case 3:
|
||||||
@@ -1530,7 +1530,7 @@ struct mkroom *broom;
|
|||||||
x = broom->hx + 1;
|
x = broom->hx + 1;
|
||||||
y = broom->ly
|
y = broom->ly
|
||||||
+ ((dpos == -1) ? rn2(1 + (broom->hy - broom->ly)) : dpos);
|
+ ((dpos == -1) ? rn2(1 + (broom->hy - broom->ly)) : dpos);
|
||||||
if (!isok(x + 1,y))
|
if (!isok(x + 1,y) || IS_ROCK(levl[x + 1][y].typ))
|
||||||
goto redoloop;
|
goto redoloop;
|
||||||
goto outdirloop;
|
goto outdirloop;
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user