Revisit the Valkyrie goal level hack

Instead of hardcoding the lava terrain change in core, if the stairs
are created in a fixed location, force the terrain to room floor first.
Move the surrounding lava changing to room floor to the Val-goal lua
file.
This commit is contained in:
Pasi Kallinen
2022-04-15 18:52:46 +03:00
parent a15b587b81
commit cb02ce88c5
5 changed files with 17 additions and 24 deletions

View File

@@ -3905,22 +3905,8 @@ l_create_stairway(lua_State *L, boolean using_ladder)
levl[x][y].ladder = LA_DOWN;
}
} else {
/* hack for Valkyrie goal level where upstairs are at a fixed
location outside the mapped area; make sure they don't get
placed on a lava spot */
if (levl[x][y].typ == LAVAPOOL) {
int tx, ty;
for (tx = x - 1; tx <= x + 1; ++tx)
for (ty = y - 1; ty <= y + 1; ++ty)
if (isok(tx, ty) && levl[tx][ty].typ == LAVAPOOL
&& ((tx == x && ty == y) || !rn2(2))) {
levl[tx][ty].typ = ROOM;
SpLev_Map[tx][ty] = 1;
}
}
mkstairs(x, y, (char) up, g.coder->croom);
mkstairs(x, y, (char) up, g.coder->croom,
!(scoord & SP_COORD_IS_RANDOM));
}
return 0;
}