static void sel_set_feature(int, int, genericptr_t);
static void levregion_add(lev_region *);
static void get_table_xy_or_coord(lua_State *, lua_Integer *, lua_Integer *);
-static int get_table_region(lua_State *, const char *, lua_Integer *, lua_Integer *, lua_Integer *,
- lua_Integer *, boolean);
+static int get_table_region(lua_State *, const char *, lua_Integer *,
+ lua_Integer *, lua_Integer *, lua_Integer *, boolean);
static void set_wallprop_in_selection(lua_State *, int);
static xchar random_wdir(void);
static int floodfillchk_match_under(int, int);
* created underwater, or eels on dry land.
*/
static void
-get_location(xchar *x, xchar *y, getloc_flags_t humidity, struct mkroom* croom)
+get_location(
+ xchar *x, xchar *y,
+ getloc_flags_t humidity,
+ struct mkroom *croom)
{
int cpt = 0;
int mx, my, sx, sy;
get_location_coord(
xchar *x, xchar *y,
int humidity,
- struct mkroom* croom,
+ struct mkroom *croom,
long crd)
{
unpacked_coord c;
* Get a relative position inside a room.
* negative values for x or y means RANDOM!
*/
-
static void
-get_room_loc(xchar* x, xchar* y, struct mkroom* croom)
+get_room_loc(xchar *x, xchar *y, struct mkroom *croom)
{
coord c;
* negative values for x or y means RANDOM!
*/
static void
-get_free_room_loc(xchar* x, xchar* y, struct mkroom* croom, packed_coord pos)
+get_free_room_loc(
+ xchar *x, xchar *y,
+ struct mkroom *croom,
+ packed_coord pos)
{
xchar try_x, try_y;
register int trycnt = 0;
}
boolean
-check_room(xchar* lowx, xchar* ddx, xchar* lowy, xchar* ddy, boolean vault)
+check_room(
+ xchar *lowx, xchar *ddx,
+ xchar *lowy, xchar *ddy,
+ boolean vault)
{
register int x, y, hix = *lowx + *ddx, hiy = *lowy + *ddy;
register struct rm *lev;
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);
}
return 0;
static const char *const mwdirs[] = {
"north", "south", "east", "west", "random", NULL
};
- static const int mwdirs2i[] = { W_NORTH, W_SOUTH, W_EAST, W_WEST, W_RANDOM, -2 };
+ static const int mwdirs2i[] = {
+ W_NORTH, W_SOUTH, W_EAST, W_WEST, W_RANDOM, -2
+ };
xchar x, y;
lua_Integer mx, my;
xchar ftyp = ROOM;